raccoon.core.types
Class AbsLoadable

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

public class AbsLoadable
extends AbsComponent
implements ILoadable, ILogable

Common features for a loadable component.

When building a component that is loadable only (neither configurable nor loggable) then it should extend/use this class.

Since:
Raccoon v0.5, refactored in Raccoon v0.8
Version:
$Id: AbsLoadable.java,v 1.1 2004/08/08 20:19:18 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
protected  boolean mIsLoaded
          The state of the component
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Constructor Summary
AbsLoadable()
           
 
Method Summary
protected  ILogger getLog()
           
 boolean isInError()
          Checks the state of this component.
 boolean isInitialised()
          Is this component initialised or not?
 boolean isRunning()
          Checks if the component has been loaded.
 void load()
          Loads or initializes the component.
 void setLogger(ILogger pLogger)
          Assigns the logger to the component.
 void unload()
          Unloads or deactivates the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mIsLoaded

protected boolean mIsLoaded
The state of the component

Constructor Detail

AbsLoadable

public AbsLoadable()
Method Detail

load

public void load()
          throws java.lang.IllegalStateException,
                 LoadableException
Loads or initializes the component.

Specified by:
load in interface ILoadable
Throws:
LoadableException - if the component couldn't load itself.
java.lang.IllegalStateException - if the component isn't in a state to load itself. for example it is already loaded.

unload

public void unload()
            throws java.lang.IllegalStateException,
                   LoadableException
Unloads or deactivates the component. The invocation of this method should be used to clean up, if necessary, all used resources.

Specified by:
unload in interface ILoadable
Throws:
LoadableException - if the component couldn't unload itself.
java.lang.IllegalStateException - if this component isn't in a state to unload itself.

isRunning

public boolean isRunning()
Checks if the component has been loaded.

Specified by:
isRunning in interface ILoadable
Returns:
true if the component has been correctly loaded.

isInError

public boolean isInError()
Checks the state of this component.

Specified by:
isInError in interface IBaseComponent
Overrides:
isInError in class AbsComponent
Returns:
true if this component is in error.

isInitialised

public boolean isInitialised()
Is this component initialised or not?

Returns:
true if the method load() has been invoked.

setLogger

public void setLogger(ILogger pLogger)
               throws java.lang.IllegalStateException,
                      ResourceNotFoundException
Assigns the logger to the component.

Specified by:
setLogger in interface ILogable
Parameters:
pLogger - the logging instance to use.
Throws:
java.lang.IllegalStateException - if the component is already loaded, valid only if the component implements the ILoadable interface.
ResourceNotFoundException - if there is an internal configuration error related to Raccoon.

getLog

protected ILogger getLog()


Copyright null null. All Rights Reserved.