raccoon.core.types
Class AbsComponentManager

java.lang.Object
  extended by raccoon.core.types.AbsComponent
      extended by raccoon.core.types.AbsLoadable
          extended by raccoon.core.types.AbsConfigurableLoadable
              extended by raccoon.core.types.AbsComponentManager
All Implemented Interfaces:
IBaseComponent, IConfigurable, ILoadable, ILogable
Direct Known Subclasses:
TibrvNucleus

public abstract class AbsComponentManager
extends AbsConfigurableLoadable

Convenience abstract class offered to the end user to handle sets of components or data caching.

Since:
Raccoon v0.4 refactored in Raccoon v0.5. Created 8 janv. 2003 at 15:57:14
Version:
$Id: AbsComponentManager.java,v 1.1 2004/08/08 20:19:18 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
 
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable
mConfigurableManager
 
Fields inherited from class raccoon.core.types.AbsLoadable
mIsLoaded
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Constructor Summary
AbsComponentManager()
          Default constructor, required by all components for dynamic instanciation.
 
Method Summary
 void clear()
          Clears all the current errors attached to this component.
 boolean isLoaded(java.lang.String pComponentName)
          Checks if the specified component is alreay loaded.
 boolean isLogable()
          The component manager doesn't log information
 void load()
          Invoked by the service manager to start this component once it has been configured.
protected abstract  IBaseComponent loadComponent(java.lang.String pComponentName)
          Generates a new instance of ComponentBase, must be implemented by inheriting classes.
 IBaseComponent lookup(java.lang.String pComponentName)
          Searches for a specific component and initilizes it if necessary.
 void unload()
          Invoked by the service manager to stop this component.
 
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable
configureParameters, isStable, setConfigurableManager, setLogger
 
Methods inherited from class raccoon.core.types.AbsLoadable
getLog, isInError, isInitialised, isRunning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsComponentManager

public AbsComponentManager()
Default constructor, required by all components for dynamic instanciation.

Method Detail

isLogable

public boolean isLogable()
The component manager doesn't log information

Returns:
false.

clear

public void clear()
Clears all the current errors attached to this component.


load

public void load()
          throws LoadableException
Invoked by the service manager to start this component once it has been configured. When extended bare in mind that the member variable mIsLoaded should be set to false and then set to true once all the init code has been performed.

Specified by:
load in interface ILoadable
Overrides:
load in class AbsConfigurableLoadable
Throws:
LoadableException - if this component isn't initialisable or is already running.

unload

public void unload()
            throws LoadableException
Invoked by the service manager to stop this component. When extended bare in mind that the member variable mIsLoaded should be set to true and then set to false once all the init code has been performed.

Specified by:
unload in interface ILoadable
Overrides:
unload in class AbsLoadable
Throws:
LoadableException - if the composant isn't running or if it isn't an initialisable component.

lookup

public IBaseComponent lookup(java.lang.String pComponentName)
                      throws RaccoonException
Searches for a specific component and initilizes it if necessary. The component has to be an instance of ComponentBase.

Parameters:
pComponentName - the logical name of the component.
Returns:
the desired IBaseComponent instance up and running.
Throws:
RaccoonException - if an error occurred while trying to load the component.

isLoaded

public boolean isLoaded(java.lang.String pComponentName)
                 throws RaccoonException
Checks if the specified component is alreay loaded.

Parameters:
pComponentName - the logical name of the component.
Returns:
true if the component is already loaded.
Throws:
RaccoonException - if this instance isn't already loaded.

loadComponent

protected abstract IBaseComponent loadComponent(java.lang.String pComponentName)
                                         throws RaccoonException
Generates a new instance of ComponentBase, must be implemented by inheriting classes.

Parameters:
pComponentName - the desired component instance.
Returns:
the new component instance.
Throws:
RaccoonException - if the instanciation failed.


Copyright null null. All Rights Reserved.