org.opa.core
Interface OPAServiceManager

All Superinterfaces:
OPAManager
All Known Implementing Classes:
OPADefaultServiceManager

public interface OPAServiceManager
extends OPAManager


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.
 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.
 
Methods inherited from interface org.opa.core.OPAManager
load, start, stop
 

Method Detail

registerService

public void registerService(java.lang.Class reference,
                            java.lang.Object serviceFacade)
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.


locateService

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


listServices

public java.lang.Object[] listServices()
Returns an array of registered facade classes. It contain the direct references to the classes.


listInterfaces

public java.lang.Class[] listInterfaces()
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.