|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.AbstractComponent
public abstract class AbstractComponent
Base implementation of Dream components. This class is provided for
convenience. It is not mandatory for a component implementation to be a
subclass 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 boolean |
fcNeedAsyncStart
|
protected String |
fcState
this attribute give the state of Dream Component. |
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 Component controller 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)
|
void |
bindFc(String clientItfName,
Object serverItf,
Object hints)
Binds the client interface whose name is given to a server interface. |
boolean |
getFcNeedAsyncStart()
Returns true if the component should be started
asynchronously. |
String |
getFcState()
|
protected void |
initComponent()
Initializes this component. |
Object |
lookupFc(String clientItfName)
|
void |
prepareStopFc()
Method called when the component enter in the "STOPPING"
state. |
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 |
---|
public Component weaveableC
Component
controller interface reference of this component
protected Logger logger
protected Logger lifeCycleLogger
protected Logger bindingLogger
protected boolean fcNeedAsyncStart
protected String fcState
LifeCycleController.STARTED
LifeCycleController.STOPPED
Constructor Detail |
---|
public AbstractComponent()
Method Detail |
---|
protected void initComponent() throws InitializationException
protected void initComponent { super.initComponent; // initialization code here ... }
InitializationException
- if an error occurs.protected void beforeFirstStart(Component componentItf) throws IllegalLifeCycleException
componentItf
- the Component
interface of this component.
IllegalLifeCycleException
public void setLogger(String name, Logger l)
Loggable
setLogger
in interface Loggable
name
- the registration name.l
- the logger.Loggable.setLogger(String, Logger)
public boolean getFcNeedAsyncStart()
NeedAsyncStartController
true
if the component should be started
asynchronously.
getFcNeedAsyncStart
in interface NeedAsyncStartController
true
if the component should be started
asynchronously.NeedAsyncStartController.getFcNeedAsyncStart()
public void prepareStopFc() throws IllegalLifeCycleException
PrepareStopLifeCycleController
"STOPPING"
state.
prepareStopFc
in interface PrepareStopLifeCycleController
IllegalLifeCycleException
PrepareStopLifeCycleController.prepareStopFc()
public String getFcState()
getFcState
in interface LifeCycleController
LifeCycleController.getFcState()
public void stopFc() throws IllegalLifeCycleException
stopFc
in interface LifeCycleController
IllegalLifeCycleException
LifeCycleController.stopFc()
public void startFc() throws IllegalLifeCycleException
startFc
in interface LifeCycleController
IllegalLifeCycleException
LifeCycleController.startFc()
public Object lookupFc(String clientItfName) throws NoSuchInterfaceException
lookupFc
in interface BindingController
NoSuchInterfaceException
BindingController.lookupFc(String)
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(String, Object)
public void bindFc(String clientItfName, Object serverItf, Object hints) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
ContextualBindingController
hints
parameter.
bindFc
in interface ContextualBindingController
clientItfName
- the name of a client interface of the component to
which this interface belongs.serverItf
- a server interface.hints
- contextual information.
NoSuchInterfaceException
- if there is no such client interface.
IllegalBindingException
- if the binding cannot be created.
IllegalLifeCycleException
- if this component has a LifeCycleController
interface,
but it is not in an appropriate state to perform this operation.ContextualBindingController.bindFc(String, Object, Object)
public void unbindFc(String clientItfName) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
unbindFc
in interface BindingController
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.unbindFc(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |