org.opa.service
Class OPADefaultServiceManager

java.lang.Object
  extended byorg.opa.service.OPADefaultServiceManager
All Implemented Interfaces:
OPAManager, OPAServiceManager

public class OPADefaultServiceManager
extends java.lang.Object
implements OPAServiceManager

This class provides a default implementation of the OPAServiceManager interface.


Constructor Summary
OPADefaultServiceManager()
          Creates a new instance of OPADefaultServiceManager
 
Method Summary
 java.lang.Class[] listInterfaces()
          Returns an array of the interfaces now registered in the service manager.
 java.lang.Object[] listServices()
          Returns an array of registered facade classes.
 void load()
          Loads the OPAManager.
 java.lang.Object locateService(java.lang.Class reference)
          Returns the facade class registered for the Interface provided in the query.
 void registerService(java.lang.Class reference, java.lang.Object serviceFacade)
          Registers a service with the service manager.
 void start()
          Starts the OPAXXXManager service.
 void stop()
          Stops the OPAXXXManager service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OPADefaultServiceManager

public OPADefaultServiceManager()
Creates a new instance of OPADefaultServiceManager

Method Detail

listInterfaces

public java.lang.Class[] listInterfaces()
Description copied from interface: OPAServiceManager
Returns an array of the interfaces now registered in the service manager. To obtain the facade class implementing the interface, pass the return result to the 'locateService()' method. Note the interfaces returned are ONLY THOSE USED IN THE SERVICE INDEX. Other interfaces may be implemented but not returned on this method call.

Specified by:
listInterfaces in interface OPAServiceManager

listServices

public java.lang.Object[] listServices()
Description copied from interface: OPAServiceManager
Returns an array of registered facade classes. It contain the direct references to the classes.

Specified by:
listServices in interface OPAServiceManager

locateService

public java.lang.Object locateService(java.lang.Class reference)
Description copied from interface: OPAServiceManager
Returns the facade class registered for the Interface provided in the query. Note that the returned Object may implement any number of other interfaces.

Specified by:
locateService in interface OPAServiceManager

registerService

public void registerService(java.lang.Class reference,
                            java.lang.Object serviceFacade)
Description copied from interface: OPAServiceManager
Registers a service with the service manager. This can then be queried later by clients requesting a perticular service. Services are registered at boot time when mmodules are loaded. The 'Loader' class provided by each module is responsible for 'pushing' the registration into the kernel. Services are indexed by the interfaces they implement and there can only be a SINGLE implementation of each interface registered. The facade class that is registered should be the public interface to a package (OPAModule). Events supplied by the module itself may access other module members directly, by name without having to use the ServiceManager.

Specified by:
registerService in interface OPAServiceManager

stop

public void stop()
Description copied from interface: OPAManager
Stops the OPAXXXManager service. This should be used to save any state (if necessary).

Specified by:
stop in interface OPAManager

start

public void start()
Description copied from interface: OPAManager
Starts the OPAXXXManager service. This should be used to restore any state (if necessary).

Specified by:
start in interface OPAManager

load

public void load()
Description copied from interface: OPAManager
Loads the OPAManager. This should be used to set-up and install any OPA services needed. For example, OPAOption panels needed by this OPAManager should be added to OPA here. This method is called before start().

Specified by:
load in interface OPAManager