org.apache.servicemix.jbi.management
Class BaseLifeCycle

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
All Implemented Interfaces:
javax.jbi.management.LifeCycleMBean, MBeanInfoProvider
Direct Known Subclasses:
AbstractFlow, BaseSystemService, ComponentMBeanImpl, ComponentStats, EndpointStats, JBIContainer, PojoSupport, SedaQueue

public abstract class BaseLifeCycle
extends Object
implements javax.jbi.management.LifeCycleMBean, MBeanInfoProvider

A BasicLifeCycle implementation

Version:
$Revision: 2153 $

Field Summary
protected  String currentState
           
static String INITIALIZED
           
protected  PropertyChangeListener listener
           
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
BaseLifeCycle()
           
 
Method Summary
protected  void firePropertyChanged(String name, Object oldValue, Object newValue)
           
 MBeanAttributeInfo[] getAttributeInfos()
          Get an array of MBeanAttributeInfo
 String getCurrentState()
          Get the current state of this managed compononent.
 String getName()
          Get the name of the item
 Object getObjectToManage()
          Get the Object to Manage
 MBeanOperationInfo[] getOperationInfos()
          Get an array of MBeanOperationInfo
 String getSubType()
          Get the type of this mbean
 String getType()
          Get the type of the item
protected  void init()
          set state to initialized
 boolean isInitialized()
           
 boolean isShutDown()
           
 boolean isStarted()
           
 boolean isStopped()
           
 boolean isUnknown()
           
protected  void setCurrentState(String newValue)
          Set the current state
 void setPropertyChangeListener(PropertyChangeListener l)
          Register for propertyChange events
 void shutDown()
          Shut down the item.
 void start()
          Start the item.
 void stop()
          Stop the item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.servicemix.jbi.management.MBeanInfoProvider
getDescription
 

Field Detail

INITIALIZED

public static final String INITIALIZED
See Also:
Constant Field Values

currentState

protected String currentState

listener

protected PropertyChangeListener listener
Constructor Detail

BaseLifeCycle

public BaseLifeCycle()
Method Detail

getName

public String getName()
Get the name of the item

Specified by:
getName in interface MBeanInfoProvider
Returns:
the name

getType

public String getType()
Get the type of the item

Specified by:
getType in interface MBeanInfoProvider
Returns:
the type

getSubType

public String getSubType()
Description copied from interface: MBeanInfoProvider
Get the type of this mbean

Specified by:
getSubType in interface MBeanInfoProvider
Returns:
the type

init

protected void init()
             throws javax.jbi.JBIException
set state to initialized

Throws:
javax.jbi.JBIException

start

public void start()
           throws javax.jbi.JBIException
Start the item.

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - if the item fails to start.

stop

public void stop()
          throws javax.jbi.JBIException
Stop the item. This suspends current messaging activities.

Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - if the item fails to stop.

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Shut down the item. The releases resources, preparatory to uninstallation.

Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Throws:
javax.jbi.JBIException - if the item fails to shut down.

getCurrentState

public String getCurrentState()
Get the current state of this managed compononent.

Specified by:
getCurrentState in interface javax.jbi.management.LifeCycleMBean
Returns:
the current state of this managed component (must be one of the string constants defined by this interface)

setCurrentState

protected void setCurrentState(String newValue)
Set the current state

Parameters:
newValue -

isStarted

public boolean isStarted()
Returns:
true if the object is in the started state

isStopped

public boolean isStopped()
Returns:
true if the object is stopped

isShutDown

public boolean isShutDown()
Returns:
true if the object is shutDown

isInitialized

public boolean isInitialized()
Returns:
true if the object is shutDown

isUnknown

public boolean isUnknown()
Returns:
true if the object is shutDown

getAttributeInfos

public MBeanAttributeInfo[] getAttributeInfos()
                                       throws JMException
Get an array of MBeanAttributeInfo

Specified by:
getAttributeInfos in interface MBeanInfoProvider
Returns:
array of AttributeInfos
Throws:
JMException

getOperationInfos

public MBeanOperationInfo[] getOperationInfos()
                                       throws JMException
Get an array of MBeanOperationInfo

Specified by:
getOperationInfos in interface MBeanInfoProvider
Returns:
array of OperationInfos
Throws:
JMException

getObjectToManage

public Object getObjectToManage()
Get the Object to Manage

Specified by:
getObjectToManage in interface MBeanInfoProvider
Returns:
the Object to Manage

setPropertyChangeListener

public void setPropertyChangeListener(PropertyChangeListener l)
Register for propertyChange events

Specified by:
setPropertyChangeListener in interface MBeanInfoProvider
Parameters:
l -

firePropertyChanged

protected void firePropertyChanged(String name,
                                   Object oldValue,
                                   Object newValue)


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.