Class RemoteService.agent.ServiceAgent
All Packages Class Hierarchy This Package Previous Next Index
Class RemoteService.agent.ServiceAgent
java.lang.Object
|
+----JavaAgent.agent.Agent
|
+----RemoteService.agent.ServiceAgent
- public class ServiceAgent
- extends Agent
ServiceAgent: Subclass of Agent which manages a set of Service objects.
When each Service is added a registration message is sent to the
ServiceBroker providing both a description and gif thumbnail. Requests for
a specific Service will be responded to with the location of the appropriate
class file.
Copyright (c) 1995, H. Robert Frost, Stanford University.
All rights reserved.
Copyright (c) 1996, H. Robert Frost, Enterprise Integration Technologies,
Inc. All rights reserved.
RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the
Government is subject to restrictions as set forth in
subparagraph(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.227-7013 and in similar clauses in the
FAR and NASA FAR supplement.
This software is bound by the terms and conditions listed in the
attached LICENSE file.
-
ServiceAgent(ContextInterface, String, URL, URL, File, File)
- Contructs a ServiceAgent.
-
addService(AvailableService)
- Called by the ServiceFrame to add a Service.
-
init()
- Creates the ServiceResourceManager, ServiceMessageHandler and reads in the
init_file.
-
removeService(String)
- Called to remove a service.
-
resourceChanged(Resource)
- Called by a Resource object when the number of elements has changed.
ServiceAgent
public ServiceAgent(ContextInterface context,
String n,
URL init_url,
URL shared_url,
File shared_dir,
File working_dir)
- Contructs a ServiceAgent.
- Parameters:
- n - String identifier for the Agent.
- init_url - URL for the initialization file.
- shared_url - URL for shared classes.
- shared_dir - Directory for local access to shared classes.
- working_dir - Directory for local files, will be null if the
Agent is unable to write to the local file system.
init
public void init()
- Creates the ServiceResourceManager, ServiceMessageHandler and reads in the
init_file.
- Overrides:
- init in class Agent
resourceChanged
public void resourceChanged(Resource r)
- Called by a Resource object when the number of elements has changed.
- Parameters:
- type - Type of the Resource.
- Overrides:
- resourceChanged in class Agent
addService
public void addService(AvailableService service)
- Called by the ServiceFrame to add a Service. Adds the AvailableService
object to the ServiceAgent's Resources then sends a register-service
message to the ANS.
- Parameters:
- service_name - Name of the service agent
removeService
public void removeService(String name)
- Called to remove a service. Sends out an unregister-service message.
- Parameters:
- name - Name of the Service.
All Packages Class Hierarchy This Package Previous Next Index