org.objectweb.dsrg.sofa.bootstrap
Class MILifecycleImpl

java.lang.Object
  extended by org.objectweb.dsrg.sofa.bootstrap.MILifecycleImpl
All Implemented Interfaces:
MILifecycle, SOFAMicroComponent, SOFAMicroInterceptor

public class MILifecycleImpl
extends java.lang.Object
implements SOFAMicroInterceptor, MILifecycle

This microcomponent connects to Lifecycle control interface and delegates calls to the base microcomponent of the Lifecycle aspect.


Constructor Summary
MILifecycleImpl()
           
 
Method Summary
 void exit()
          Call to this method will start the stopping process.
 java.lang.Object getDelegatedProvided()
          Takes reference to delegated provided interface implementation.
 java.lang.Object getProvided(java.lang.String name)
          Takes reference to implementation of provided interface with given name.
 LifecycleState getState()
          Gets the lifecycle state of the component.
 void init(ComponentDescription component, java.util.Map<java.lang.String,java.lang.String> parameters)
          Initialises microcomponent.
 void setDelegatedRequired(java.lang.Object ref)
          Gives the microcomponent reference to interface where to delegate calls.
 void setRequired(java.lang.String name, java.lang.Object ref)
          Gives the microcomponent reference to destination of its required interface.
 void start()
          Call to this method starts the component.
 void stop()
          Call to this method will start the stopping process.
 void waitStopped()
          Wait until the component is stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MILifecycleImpl

public MILifecycleImpl()
Method Detail

start

public void start()
Description copied from interface: MILifecycle
Call to this method starts the component. When this method returns the component is started.

Specified by:
start in interface MILifecycle

stop

public void stop()
Description copied from interface: MILifecycle
Call to this method will start the stopping process. Component will block incoming calls on business interfaces. This method should not block.

Call to waitStopped is needed to complete component stopping process.

Specified by:
stop in interface MILifecycle

exit

public void exit()
Description copied from interface: MILifecycle
Call to this method will start the stopping process. Component will interrupt incoming calls to business interfaces. This method shouldd not block.

Call to waitStopped is needed to complete component stopping process.

Specified by:
exit in interface MILifecycle

waitStopped

public void waitStopped()
Description copied from interface: MILifecycle
Wait until the component is stopped. The stopping process have to be started by stop() or exit() methods before calling this method. The component will not be stopped until this method is called.

Specified by:
waitStopped in interface MILifecycle

getState

public LifecycleState getState()
Description copied from interface: MILifecycle
Gets the lifecycle state of the component.

Specified by:
getState in interface MILifecycle

init

public void init(ComponentDescription component,
                 java.util.Map<java.lang.String,java.lang.String> parameters)
Description copied from interface: SOFAMicroComponent
Initialises microcomponent. This method is called after all microcomponents are instantiated and bound.

Specified by:
init in interface SOFAMicroComponent
Parameters:
component - Containing component description.
parameters - Parameters from the model extended by parameters from the Sofa2 runtime.

getDelegatedProvided

public java.lang.Object getDelegatedProvided()
Description copied from interface: SOFAMicroInterceptor
Takes reference to delegated provided interface implementation.

Specified by:
getDelegatedProvided in interface SOFAMicroInterceptor
Returns:
Reference to delegated provided interface implementation.

setDelegatedRequired

public void setDelegatedRequired(java.lang.Object ref)
                          throws SOFAException
Description copied from interface: SOFAMicroInterceptor
Gives the microcomponent reference to interface where to delegate calls.

Specified by:
setDelegatedRequired in interface SOFAMicroInterceptor
Parameters:
ref - Interface implementation reference to delegate to.
Throws:
SOFAException

getProvided

public java.lang.Object getProvided(java.lang.String name)
                             throws SOFAException
Description copied from interface: SOFAMicroComponent
Takes reference to implementation of provided interface with given name.

Specified by:
getProvided in interface SOFAMicroComponent
Parameters:
name - Name of the provided interface.
Returns:
Reference to the provided interface implementation.
Throws:
SOFAException

setRequired

public void setRequired(java.lang.String name,
                        java.lang.Object ref)
                 throws SOFAException
Description copied from interface: SOFAMicroComponent
Gives the microcomponent reference to destination of its required interface.

Specified by:
setRequired in interface SOFAMicroComponent
Parameters:
name - Name of the required interface.
ref - Reference to the destination interface implementation.
Throws:
SOFAException