Class RemoteService.resource.Service
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class RemoteService.resource.Service

java.lang.Object
   |
   +----RemoteService.resource.Service

public class Service
extends Object
Provides a generic interface to a remote service. Specific services will be represented by subclasses of this class. Class files for each Service are obtained by DesignAgents from ServiceAgents. The DesignAgent, after loading the class file, will instantiate the Service subclass and then call the run() method to execute the service interface. The Service object can communicate, via the DesignAgent, with both other agents (by using the DA's sendMessage() method) and with service-specific ProD code (by using the DA's send_ProI_message() method).
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 name
String name for this Service, used as an identifier in messages and in storage Hashtables.
 o parent
ClientAgent which instantiated this Service object.
 o service_agent
Name of ServiceAgent which supplied the Service class file.

Constructor Index

 o Service()
Creates a new Service object.

Method Index

 o addSystemMessage(String)
Sends a system message to the agent.
 o addSystemMessage(String, Exception)
Sends a system message to the agent w/ exception.
 o getName()
Returns the name of the Service.
 o message_received(String, String)
Called when a message is received from the ProIntegrator for this Service object.
 o run()
Executes the Service interface.
 o setParams(String, ClientAgent)
 o stop()
Stops the service.

Variables

 o name
  protected String name
String name for this Service, used as an identifier in messages and in storage Hashtables.
 o parent
  protected ClientAgent parent
ClientAgent which instantiated this Service object.
 o service_agent
  public static String service_agent
Name of ServiceAgent which supplied the Service class file.

Constructors

 o Service
  public Service()
Creates a new Service object.

Methods

 o setParams
  public void setParams(String n,
                        ClientAgent ca)
 o getName
  public String getName()
Returns the name of the Service.
Returns:
String name of the Service.
 o run
  public void run()
Executes the Service interface. Specific actions must be implemented for each subclass.
 o stop
  public void stop()
Stops the service.
 o message_received
  public void message_received(String message,
                               String sender)
Called when a message is received from the ProIntegrator for this Service object. The message will most likely originate from the Service specific ProD code. Specific actions must be implemented for each subclass.
Parameters:
message - Message content
sender - Message origin
 o addSystemMessage
  public void addSystemMessage(String message)
Sends a system message to the agent.
Parameters:
message - The system message to output.
 o addSystemMessage
  public void addSystemMessage(String message,
                               Exception e)
Sends a system message to the agent w/ exception.
Parameters:
message - The system message to output.
e - Exception which generated the message, may be null.

All Packages  Class Hierarchy  This Package  Previous  Next  Index