org.objectweb.dream
Class AbstractComponent

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
All Implemented Interfaces:
BindingController, LifeCycleController, Loggable
Direct Known Subclasses:
AbstractMessageCodecDataStream, AbstractThreadTask, CodecManagerImpl, CodecRepositoryImpl, ForwarderSchedulerImpl, MessageManagerImpl, NonExtensibleMessageManagerPoolImpl, ObjectPoolImpl, PushPushDreamComponent, PushToPush1Impl

public abstract class AbstractComponent
extends Object
implements LifeCycleController, BindingController, Loggable

Base implementation of Dream components. This class is provided for convenience. It is not mandatory for a component implementation to be a subclasse of this class.
This class provides implementation of BindingController methods. Bindings are stored in a Map. When a component has client interfaces, it is recommended to override (at least) the bindFc method.


Field Summary
protected  Logger bindingLogger
          the controller logger associated with the binding controller of this component
protected  Component componentDesc
          The Componentdescription object associated with this component
protected  String fcState
          this attribut give the state of Dream Component.
protected  boolean firstStart
          A boolean that indicates whether this is the first start or not.
protected  Logger lifeCycleLogger
          the controller logger associated with the life cycle controller of this component
protected  Logger logger
          the functional logger of this component
 Component weaveableC
          the Componentcontroller interface reference of this component
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractComponent()
          Constructor method create the hashtable of bindings and initialize fcState to LifeCycleController.STOPPED.
 
Method Summary
protected  void beforeFirstStart(Component componentItf)
          This method is called the first time the component is started.
 void bindFc(String clientItfName, Object serverItf)
           
 String getFcState()
           
protected  void initComponent(Component componentItf)
          Initializes this component.
 Object lookupFc(String clientItfName)
           
 void setLogger(String name, Logger l)
          Gives the logger.
 void startFc()
           
 void stopFc()
           
 void unbindFc(String clientItfName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.fractal.api.control.BindingController
listFc
 

Field Detail

weaveableC

public Component weaveableC
the Componentcontroller interface reference of this component


logger

protected Logger logger
the functional logger of this component


lifeCycleLogger

protected Logger lifeCycleLogger
the controller logger associated with the life cycle controller of this component


bindingLogger

protected Logger bindingLogger
the controller logger associated with the binding controller of this component


fcState

protected String fcState
this attribut give the state of Dream Component.
the fcSstate value is LifeCycleController.STARTED LifeCycleController.STOPPED


componentDesc

protected Component componentDesc
The Componentdescription object associated with this component


firstStart

protected boolean firstStart
A boolean that indicates whether this is the first start or not.

Constructor Detail

AbstractComponent

public AbstractComponent()
Constructor method create the hashtable of bindings and initialize fcState to LifeCycleController.STOPPED.

Method Detail

initComponent

protected void initComponent(Component componentItf)
                      throws InitializationException
Initializes this component. This method is called during initialization of the component controllers.
This method can be overriden by sub classes as follows:
 
 protected void initComponent(Component componentItf)
 {
   super.initComponent(componentItf);
   // initialisation code here ...
 }
 
 
 

Parameters:
componentItf - the Componentinterface of this component.
Throws:
InitializationException - if an error occurs.

beforeFirstStart

protected void beforeFirstStart(Component componentItf)
                         throws IllegalLifeCycleException
This method is called the first time the component is started.

Parameters:
componentItf - the Componentinterface of this component.
Throws:
IllegalLifeCycleException

setLogger

public void setLogger(String name,
                      Logger l)
Description copied from interface: Loggable
Gives the logger.

Specified by:
setLogger in interface Loggable
Parameters:
name - the registration name.
l - the logger.
See Also:
Loggable.setLogger(String, Logger)

getFcState

public String getFcState()
Specified by:
getFcState in interface LifeCycleController
See Also:
LifeCycleController.getFcState()

stopFc

public void stopFc()
            throws IllegalLifeCycleException
Specified by:
stopFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.stopFc()

startFc

public void startFc()
             throws IllegalLifeCycleException
Specified by:
startFc in interface LifeCycleController
Throws:
IllegalLifeCycleException
See Also:
LifeCycleController.startFc()

lookupFc

public Object lookupFc(String clientItfName)
                throws NoSuchInterfaceException
Specified by:
lookupFc in interface BindingController
Throws:
NoSuchInterfaceException
See Also:
BindingController.lookupFc(String)

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)

unbindFc

public void unbindFc(String clientItfName)
              throws NoSuchInterfaceException,
                     IllegalBindingException,
                     IllegalLifeCycleException
Specified by:
unbindFc in interface BindingController
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.unbindFc(String)


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.