org.objectweb.telosys.service
Class StandardServiceRegistry

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.service.StandardServiceRegistry
All Implemented Interfaces:
IServiceProvider

public class StandardServiceRegistry
extends TelosysObject
implements IServiceProvider

This is the standard ancestor class designed to build a "Service Registry" ( "Service Provider" )
It provides the "register" and "registerServicePackage" methods designed
to be used in the child class.


Constructor Summary
StandardServiceRegistry()
          Constructor
 
Method Summary
 ScreenService getService(java.lang.String sServiceName)
          Returns an instance of the service identified by its name
 java.lang.String getSessionKey(java.lang.String sServiceName)
          Returns the key used to store the service result in the ScreenSession
 void init()
          Initializes the screen provider using the current Telosys properties
protected  void register(java.lang.String serviceName, java.lang.Class serviceClass, java.lang.String sRenderer, java.lang.String sSessionKey)
          Register the service for future use.
protected  void registerServicePackage(java.lang.String sPackage)
          Register the given package as a "service package"
( a package that can contain Telosys Service Classes )
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardServiceRegistry

public StandardServiceRegistry()
Constructor

Since:
1.0.5
Method Detail

init

public void init()
Description copied from interface: IServiceProvider
Initializes the screen provider using the current Telosys properties

Specified by:
init in interface IServiceProvider

getService

public ScreenService getService(java.lang.String sServiceName)
                         throws TelosysException
Description copied from interface: IServiceProvider
Returns an instance of the service identified by its name

Specified by:
getService in interface IServiceProvider
Parameters:
sServiceName - the name of the service
Returns:
the service instance
Throws:
TelosysException

getSessionKey

public java.lang.String getSessionKey(java.lang.String sServiceName)
                               throws TelosysException
Description copied from interface: IServiceProvider
Returns the key used to store the service result in the ScreenSession

Specified by:
getSessionKey in interface IServiceProvider
Parameters:
sServiceName - the name of the service
Returns:
the key (can be null if no result storage)
Throws:
TelosysException

register

protected final void register(java.lang.String serviceName,
                              java.lang.Class serviceClass,
                              java.lang.String sRenderer,
                              java.lang.String sSessionKey)
Register the service for future use.

Parameters:
serviceName - the logical name of the service
serviceClass - the class where the service is implemented
sRenderer - the renderer used to build the "result view" (no view if null)
sSessionKey - the key used to store the result in session (not stored if null)

registerServicePackage

protected final void registerServicePackage(java.lang.String sPackage)
Register the given package as a "service package"
( a package that can contain Telosys Service Classes )

Parameters:
sPackage -