ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.platform
Class RmiAgentLifeCycleServiceFactory

java.lang.Object
  |
  +--com.ibm.able.platform.RmiAgentLifeCycleServiceFactory
All Implemented Interfaces:
org.jagent.service.spi.ServiceFactory

public class RmiAgentLifeCycleServiceFactory
extends java.lang.Object
implements org.jagent.service.spi.ServiceFactory

This class either finds or creates, as needed, an RMI version of an Agent Lifecycle Service object, and returns it in a proxy object.


Constructor Summary
RmiAgentLifeCycleServiceFactory()
          Creates a factory that knows how to find or create an RMI version of an Agent Lifecycle Service object.
 
Method Summary
static java.lang.String Copyright()
          Gets the copyright statement of this class.
 javax.agent.service.Service getService(javax.agent.service.ServiceProperties theServiceProperties)
          Creates or finds an RMI version of an Agent Lifecycle Service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RmiAgentLifeCycleServiceFactory

public RmiAgentLifeCycleServiceFactory()
Creates a factory that knows how to find or create an RMI version of an Agent Lifecycle Service object.
Method Detail

getService

public javax.agent.service.Service getService(javax.agent.service.ServiceProperties theServiceProperties)
                                       throws javax.agent.service.ServiceException
Creates or finds an RMI version of an Agent Lifecycle Service.

Special requirements for the desired service are supplied using the ServiceProperties parameter. Service Properties that this factory examines are:

If the service properties indicate that the desired service is to be located on the host on which this code is running, this factory will attempt to first look up the service in the appropriate (local) RMI registry. If the service is not there, the factory will next attempt to create the service from scratch -- this may even involve creating the RMI registry itself. In other words, if the service is to be here on the local machine,

  1. Get the registry at the specified port
  2. If the registry doesn't exit, create both it and the service
  3. If the registry exists, but the service isn't registered, just create the service
  4. If the registry and the service both exist, simply return the (looked-up) service

If the service properties indicate that the desired service is located on some other host than where this code is running, the factory will attempt to look up the service on the specified host and port. If the desired service is not there, there is no way to create the service remotely, so this method will fail with a ServiceException.

If the desired service can be found or created successfully, the service is returned in the form of a non-RMI proxy.

Specified by:
getService in interface org.jagent.service.spi.ServiceFactory
Parameters:
theServiceProperties - The non-null service properties specifying information to be used in the creation of the Service. Service Properties that this factory examines are:
  • RMIService.SERVICE_HOST
  • RMIService.SERVICE_PORT
  • AbleBasicService.REQUESTORS_PORT

If no SERVICE_HOST property is specified, the local host is assumed.

If no SERVICE_PORT property is specified, the default JAVA RMI port is assumed.

If the service needs to be created locally, all service properties are passed on to the service's constructor.

Returns:
A non-null service object that implements the Service interface.
Throws:
javax.agent.service.ServiceException - If the desired service cannot be located or created.

Copyright

public static java.lang.String Copyright()
Gets the copyright statement of this class.
Returns:
this class's copyright statement.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003