Class RemoteService.agent.ClientAgent
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class RemoteService.agent.ClientAgent

java.lang.Object
   |
   +----JavaAgent.agent.Agent
           |
           +----RemoteService.agent.ClientAgent

public class ClientAgent
extends Agent
ClientAgent: Subclass of Agent which is integrated with a local process and communicates with remote services (represented by ServiceAgents). Each remote service exports an interface, represented by a subclass of Service, which is executed on the ClientAgent's machine. This Service object can perform local file IO and communicate with both a local process and the ServiceAgent to carryout the represented service.


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.



Variable Index

 o pending_service
Service waiting to be installed

Constructor Index

 o ClientAgent(ContextInterface, String, URL, URL, File, File)
Contructs a ClientAgent.

Method Index

 o executeService(String)
Called to execute a specific Service.
 o getAvailable()
Request for a list of available services.
 o init()
Creates the ResourceManager, MessageHandler and reads in the init_file.
 o initiateTermination()
Called when the executable class which contains the Agent terminates.
 o installService(String)
Called by the ClientContext to install a specific service.
 o NonAgentMsg(String, Service, boolean)
Called by a Service object to send a String message.
 o PipeMsgReceived(String)
Called when a message is received through the PipeCommunicator.
 o resourceChanged(Resource)
Called by a Resource object when the number of elements has changed.
 o runService(String)
Called to run a installed Service.
 o sendInitMessages()
Group of messages which are automatically sent out at startup.

Variables

 o pending_service
  protected String pending_service
Service waiting to be installed

Constructors

 o ClientAgent
  public ClientAgent(ContextInterface context,
                     String n,
                     URL init_url,
                     URL shared_url,
                     File shared_dir,
                     File working_dir)
Contructs a ClientAgent.
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.

Methods

 o init
  public void init()
Creates the ResourceManager, MessageHandler and reads in the init_file.
Overrides:
init in class Agent
 o sendInitMessages
  public void sendInitMessages()
Group of messages which are automatically sent out at startup. If the name submitted by the agent is non-unique, these message will be resent with the unique name.
Overrides:
sendInitMessages in class Agent
 o NonAgentMsg
  public void NonAgentMsg(String message,
                          Service s,
                          boolean interrupt)
Called by a Service object to send a String message. Appends the Service name (or "DesignAgent") to the front of the message.
Parameters:
message - The String to send.
s - Service which is sending the message, if null send as DesignAgent
interrupt - Should an interrupt be sent following the message, for synchronous comm. no interrupt is necessary.
 o PipeMsgReceived
  public void PipeMsgReceived(String message)
Called when a message is received through the PipeCommunicator.
Parameters:
message - String received.
 o initiateTermination
  public void initiateTermination()
Called when the executable class which contains the Agent terminates. The agent sends a remove-address message to the ANS.
Overrides:
initiateTermination in class Agent
 o 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
 o getAvailable
  public void getAvailable()
Request for a list of available services. Results in a message being sent to the ServiceBroker(ANS) requesting the list of currently registered services.
 o executeService
  public void executeService(String name)
Called to execute a specific Service. The Service will be loaded first, if necessary.
Parameters:
name - Name of the Service.
 o runService
  protected void runService(String name)
Called to run a installed Service.
Parameters:
name - Name of the Service.
 o installService
  protected void installService(String service_name)
Called by the ClientContext to install a specific service. If the Service has not already been installed, results in a message being sent to the appropriate service agent requesting the service interface.
Parameters:
service_name - Name of the service agent

All Packages  Class Hierarchy  This Package  Previous  Next  Index