raccoon.api.types
Interface IServiceManager

All Known Implementing Classes:
ServiceManager

public interface IServiceManager

The Service Manager defined in the SOA document.

Since:
Raccoon v0.7
Version:
$Id: IServiceManager.java,v 1.1 2004/08/08 20:25:57 crouvrais Exp $
Author:
Cedric ROUVRAIS

Method Summary
 java.lang.String getConfigurationName()
          Convenience method to check in debug mode if this service manager is using the right configuration file.
 boolean isLoaded(java.lang.String pComponentName)
          Checks if a given service is already loaded, convenience method for faster access.
 boolean isLoaded(java.lang.String pComponentName, java.lang.String pComponentKey)
          Checks if a given service is already loaded, convenience method for faster access.
 boolean isStable(boolean pThrowOnError)
          Checks the state of the component.
 IBaseComponent lookup(java.lang.String pComponentName)
          Retrieves a component that has been loaded and initialised based upon it's logical name.
 IBaseComponent lookup(java.lang.String pComponentName, java.lang.String pComponentKey)
          Retrieves a component that has been loaded and initialised based upon it's logical key name.
 IBaseComponent lookup(java.lang.String pComponentName, java.lang.String pComponentKey, java.util.Hashtable pBeanProperties)
          Retrieves a component that has been loaded and initialised based upon it's logical key name.
 void shutdown(boolean pThrowOnError)
          Shuts down all the loaded components.
 

Method Detail

getConfigurationName

java.lang.String getConfigurationName()
Convenience method to check in debug mode if this service manager is using the right configuration file.

Returns:
the logical name of the configuration file (the name attribute of <service>

lookup

IBaseComponent lookup(java.lang.String pComponentName)
                      throws RaccoonException
Retrieves a component that has been loaded and initialised based upon it's logical name.

Parameters:
pComponentName - the name of the component that was given in the configuration file.
Returns:
the IBaseComponent instance loaded and initialised if necessary.
Throws:
RaccoonException - if the component couldn't be loaded or found.

isLoaded

boolean isLoaded(java.lang.String pComponentName)
                 throws RaccoonException
Checks if a given service is already loaded, convenience method for faster access.

Invoking this method first will avoid instiating various objects if the service is already loaded by just calling lookup(java.lang.String)

Parameters:
pComponentName - the logical name of the component.
Returns:
true if the object already exists within this instance of the service manager.
Throws:
RaccoonException - if the service manager isn't stable.

isLoaded

boolean isLoaded(java.lang.String pComponentName,
                 java.lang.String pComponentKey)
                 throws RaccoonException
Checks if a given service is already loaded, convenience method for faster access.

Invoking this method first will avoid instiating various objects if the service is already loaded by just calling lookup(java.lang.String)

Parameters:
pComponentName - the logical name of the component.
pComponentKey - a unique key that is used to identify this given component (for example a thread-id).
Returns:
true if the object already exists within this instance of the service manager.
Throws:
RaccoonException - if the service manager isn't stable.

lookup

IBaseComponent lookup(java.lang.String pComponentName,
                      java.lang.String pComponentKey,
                      java.util.Hashtable pBeanProperties)
                      throws RaccoonException
Retrieves a component that has been loaded and initialised based upon it's logical key name.

Parameters:
pComponentName - the name of the component that was given in the configuration file.
pComponentKey - a unique key that is used to identify this given component (for example a thread-id).
pBeanProperties - the bean properties that are to be set before invoking the load method.
Returns:
the IBaseComponent instance loaded and initialised if necessary.
Throws:
RaccoonException - if the component couldn't be loaded or found.

lookup

IBaseComponent lookup(java.lang.String pComponentName,
                      java.lang.String pComponentKey)
                      throws RaccoonException
Retrieves a component that has been loaded and initialised based upon it's logical key name.

This method is useful when several instances of a given component need to be created. For example when a component isn't thread safe, passing the thread-id as the key will result in the creation of a component instance per existing thread.

Another useful situation is when a component is category orientated like the Log4j component: here the key would be the category.

Parameters:
pComponentName - the name of the component that was given in the configuration file.
pComponentKey - the name of the key that was given to this component (for example a thread id).
Returns:
the IBaseComponent instance loaded and initialised if necessary.
Throws:
RaccoonException - if the component couldn't be loaded or found.

isStable

boolean isStable(boolean pThrowOnError)
                 throws RaccoonException
Checks the state of the component.

Parameters:
pThrowOnError - if the component is unstable should an exception be thrown?
Returns:
true if the component is in a stable state.
Throws:
RaccoonException - if pThrowOnError is true and if the component is in an unstable state

shutdown

void shutdown(boolean pThrowOnError)
              throws RaccoonException
Shuts down all the loaded components.

Parameters:
pThrowOnError - if true will throw an exception containing all the errors that occured whilst halting the loaded services.
Throws:
RaccoonException - if pThrowOnError is true and errors occur.


Copyright null null. All Rights Reserved.