Class RemoteService.agent.ServiceBroker
All Packages Class Hierarchy This Package Previous Next Index
Class RemoteService.agent.ServiceBroker
java.lang.Object
|
+----JavaAgent.agent.Agent
|
+----JavaAgent.agent.ANS
|
+----RemoteService.agent.ServiceBroker
- public class ServiceBroker
- extends ANS
ServiceBroker is a subclass of ANS which functions as a central repository
of Services for a group of Client and Service Agents. The ServiceBroker
maintains a listing of registered services and the ServiceAgents which
manage them.
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.
-
clients
- Contains the names of all Agent's who have submitted ask-available
messages.
-
ServiceBroker(ContextInterface, String, URL, URL, File, File)
- Contructs a ServiceBroker.
-
addClient(String)
- Adds a name to the clients list.
-
getClients()
-
-
init()
- Creates the ResourceManager, MessageHandler and reads in the init_file.
-
removeClient(String)
- Removes a name from the clients list.
-
resourceChanged(Resource)
- Called by a Resource object when the number of elements has changed.
-
SendUnregisterMessage(String, String)
- Send unregister-service messages to all of the agents in the address
buffer.
clients
protected Vector clients
- Contains the names of all Agent's who have submitted ask-available
messages. When a service is registered or unregistered, all of the
agents in this list are informed.
ServiceBroker
public ServiceBroker(ContextInterface context,
String n,
URL init_url,
URL shared_url,
File shared_dir,
File working_dir)
- Contructs a ServiceBroker.
- 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 ResourceManager, MessageHandler and reads in the init_file.
- Overrides:
- init in class ANS
addClient
public void addClient(String client)
- Adds a name to the clients list.
- Parameters:
- client - Name of the agent.
removeClient
public void removeClient(String client)
- Removes a name from the clients list.
- Parameters:
- client - Name of the agent.
getClients
public Enumeration getClients()
- Returns:
- An enumeration of all the client agent names.
SendUnregisterMessage
public void SendUnregisterMessage(String name,
String service_agent)
- Send unregister-service messages to all of the agents in the address
buffer.
- Parameters:
- name - Service name which is being unregistered.
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
All Packages Class Hierarchy This Package Previous Next Index