org.ow2.petals.container.lifecycle
Class AbstractLifeCycle

java.lang.Object
  extended by org.ow2.petals.container.lifecycle.AbstractLifeCycle
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean
Direct Known Subclasses:
ComponentLifeCycle, ServiceAssemblyLifeCycle

public abstract class AbstractLifeCycle
extends java.lang.Object
implements javax.jbi.management.LifeCycleMBean

Implementation of the LifeCycle mbean. This lifecycle mbean sends notifications about changes of state.

Author:
Adrien LOUIS - EBM WebSourcing

Field Summary
protected  java.lang.Object activitySynchronizer
           
protected  boolean forcedState
          Force the set of a state, ignoring eventual errors when changing of states
protected  boolean initialized
           
protected  org.ow2.petals.util.LoggingUtil log
           
protected  java.lang.String name
           
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
AbstractLifeCycle()
          Creates a new instance of AbstractLifeCycle
 
Method Summary
abstract  void doInit()
           
abstract  void doShutdown()
           
abstract  void doStart()
           
abstract  void doStop()
           
 java.lang.String getCurrentState()
           
protected abstract  java.lang.String getJBIArtifactType()
           
 boolean isShutdownState()
           
 boolean isStartedState()
           
 boolean isStoppedState()
           
 boolean isUnknownState()
           
 void setForcedState(boolean forcedState)
           
protected  void setState(java.lang.String state)
          Set the State reference of the current state.
 void shutDown()
          Shutdown the component.
 void start()
          Start the component.
 void stop()
          Stop the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

activitySynchronizer

protected java.lang.Object activitySynchronizer

initialized

protected boolean initialized

log

protected org.ow2.petals.util.LoggingUtil log

name

protected java.lang.String name

forcedState

protected boolean forcedState
Force the set of a state, ignoring eventual errors when changing of states

Constructor Detail

AbstractLifeCycle

public AbstractLifeCycle()
Creates a new instance of AbstractLifeCycle

Method Detail

doInit

public abstract void doInit()
                     throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

doShutdown

public abstract void doShutdown()
                         throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

doStart

public abstract void doStart()
                      throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

doStop

public abstract void doStop()
                     throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getCurrentState

public java.lang.String getCurrentState()
Specified by:
getCurrentState in interface javax.jbi.management.LifeCycleMBean
See Also:
LifeCycleMBean.getCurrentState()

isShutdownState

public boolean isShutdownState()

isStartedState

public boolean isStartedState()

isStoppedState

public boolean isStoppedState()

isUnknownState

public boolean isUnknownState()

setForcedState

public void setForcedState(boolean forcedState)

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Shutdown the component. A notification will be thrown in case of runtimeException or incoherent state.

Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - in case of runtimeException or incoherent state.
See Also:
javax.jbi.management.LifeCycleMBean#shutdown()

start

public void start()
           throws javax.jbi.JBIException
Start the component. A notification will be thrown in case of runtimeException or incoherent state.

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - in case of runtimeException or incoherent state.
See Also:
LifeCycleMBean.start()

stop

public void stop()
          throws javax.jbi.JBIException
Stop the component. A notification will be thrown in case of runtimeException or incoherent state.

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - in case of runtimeException or incoherent state.
See Also:
LifeCycleMBean.stop()

getJBIArtifactType

protected abstract java.lang.String getJBIArtifactType()

setState

protected void setState(java.lang.String state)
                 throws javax.jbi.JBIException
Set the State reference of the current state. An LifeCycleStateEventAbstract is thrown.

Parameters:
state -
Throws:
javax.jbi.JBIException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.