Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi
Class AbstractLifecycle

java.lang.Object
  extended by org.apache.tuscany.spi.AbstractLifecycle
All Implemented Interfaces:
Lifecycle
Direct Known Subclasses:
AbstractSCAObject

public abstract class AbstractLifecycle
extends Object
implements Lifecycle

Base class providing a simple implementation of Lifecycle.

Version:
$Rev: 430937 $ $Date: 2006-08-11 18:17:56 -0700 (Fri, 11 Aug 2006) $

Field Summary
protected  int lifecycleState
           
 
Fields inherited from interface org.apache.tuscany.spi.Lifecycle
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
AbstractLifecycle()
           
 
Method Summary
 int getLifecycleState()
          Returns the lifecycle state
protected  void setLifecycleState(int lifecycleState)
          Set the current state of the Lifecycle.
 void start()
          Starts the Lifecycle.
 void stop()
          Stops the Lifecycle.
 String toString()
          Returns the current lifecycle as a String (for example, "RUNNING").
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lifecycleState

protected volatile int lifecycleState
Constructor Detail

AbstractLifecycle

public AbstractLifecycle()
Method Detail

getLifecycleState

public int getLifecycleState()
Description copied from interface: Lifecycle
Returns the lifecycle state

Specified by:
getLifecycleState in interface Lifecycle
See Also:
Lifecycle.UNINITIALIZED, Lifecycle.INITIALIZING, Lifecycle.INITIALIZED, Lifecycle.RUNNING, Lifecycle.STOPPING, Lifecycle.STOPPED

setLifecycleState

protected void setLifecycleState(int lifecycleState)
Set the current state of the Lifecycle.

Parameters:
lifecycleState - the new state

start

public void start()
Description copied from interface: Lifecycle
Starts the Lifecycle.

Specified by:
start in interface Lifecycle

stop

public void stop()
Description copied from interface: Lifecycle
Stops the Lifecycle.

Specified by:
stop in interface Lifecycle

toString

public String toString()
Returns the current lifecycle as a String (for example, "RUNNING").

Overrides:
toString in class Object
Returns:
the current lifecycle as a String

Apache Tuscany SCA Kernel Sub-Project

-