org.apache.servicemix.jbi.framework
Class ServiceUnitLifeCycle

java.lang.Object
  extended by org.apache.servicemix.jbi.framework.ServiceUnitLifeCycle
All Implemented Interfaces:
ServiceUnitMBean, MBeanInfoProvider

public class ServiceUnitLifeCycle
extends Object
implements ServiceUnitMBean, MBeanInfoProvider


Field Summary
 
Fields inherited from interface org.apache.servicemix.jbi.framework.ServiceUnitMBean
SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
ServiceUnitLifeCycle(ServiceUnit serviceUnit, String serviceAssembly, Registry registry, File rootDir)
           
 
Method Summary
protected  void checkComponentStarted(String task)
           
protected  void checkComponentStartedOrStopped(String task)
           
protected  void fireEvent(int type)
           
protected  void firePropertyChanged(String name, Object oldValue, Object newValue)
           
 MBeanAttributeInfo[] getAttributeInfos()
          Get an array of MBeanAttributeInfo
protected  ClassLoader getComponentClassLoader()
           
 String getComponentName()
           
 String getCurrentState()
           
 String getDescription()
          Get the Description of the item
 String getDescriptor()
           
 String getKey()
           
 String getName()
          Get the name of the item
 Object getObjectToManage()
          Get the Object to Manage
 MBeanOperationInfo[] getOperationInfos()
          Get an array of MBeanOperationInfo
 String getServiceAssembly()
           
 Services getServices()
           
protected  javax.jbi.component.ServiceUnitManager getServiceUnitManager()
           
protected  File getServiceUnitRootPath()
           
 String getSubType()
          Get the type of this mbean
 String getType()
          Get the type of this mbean
 void init()
          Initialize the service unit.
 boolean isShutDown()
           
 boolean isStarted()
           
 boolean isStopped()
           
 void setPropertyChangeListener(PropertyChangeListener l)
          Register for propertyChange events
 void shutDown()
          Shut down the service unit.
 void start()
          Start the service unit.
 void stop()
          Stop the service unit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceUnitLifeCycle

public ServiceUnitLifeCycle(ServiceUnit serviceUnit,
                            String serviceAssembly,
                            Registry registry,
                            File rootDir)
Method Detail

init

public void init()
          throws javax.jbi.management.DeploymentException
Initialize the service unit.

Throws:
javax.jbi.management.DeploymentException

start

public void start()
           throws javax.jbi.management.DeploymentException
Start the service unit.

Throws:
javax.jbi.management.DeploymentException

stop

public void stop()
          throws javax.jbi.management.DeploymentException
Stop the service unit. This suspends current messaging activities.

Throws:
javax.jbi.management.DeploymentException

shutDown

public void shutDown()
              throws javax.jbi.management.DeploymentException
Shut down the service unit. This releases resources, preparatory to uninstallation.

Throws:
javax.jbi.management.DeploymentException

getCurrentState

public String getCurrentState()
Specified by:
getCurrentState in interface ServiceUnitMBean
Returns:
the currentState as a String

isShutDown

public boolean isShutDown()

isStopped

public boolean isStopped()

isStarted

public boolean isStarted()

getName

public String getName()
Description copied from interface: MBeanInfoProvider
Get the name of the item

Specified by:
getName in interface ServiceUnitMBean
Specified by:
getName in interface MBeanInfoProvider
Returns:
the name of the ServiceAssembly

getDescription

public String getDescription()
Description copied from interface: MBeanInfoProvider
Get the Description of the item

Specified by:
getDescription in interface ServiceUnitMBean
Specified by:
getDescription in interface MBeanInfoProvider
Returns:
the description of the ServiceAssembly

getComponentName

public String getComponentName()
Specified by:
getComponentName in interface ServiceUnitMBean

getServiceAssembly

public String getServiceAssembly()
Specified by:
getServiceAssembly in interface ServiceUnitMBean

getDescriptor

public String getDescriptor()
Specified by:
getDescriptor in interface ServiceUnitMBean

getServices

public Services getServices()

checkComponentStarted

protected void checkComponentStarted(String task)
                              throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

checkComponentStartedOrStopped

protected void checkComponentStartedOrStopped(String task)
                                       throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

getServiceUnitRootPath

protected File getServiceUnitRootPath()

getServiceUnitManager

protected javax.jbi.component.ServiceUnitManager getServiceUnitManager()

getComponentClassLoader

protected ClassLoader getComponentClassLoader()

getAttributeInfos

public MBeanAttributeInfo[] getAttributeInfos()
                                       throws JMException
Description copied from interface: MBeanInfoProvider
Get an array of MBeanAttributeInfo

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

getOperationInfos

public MBeanOperationInfo[] getOperationInfos()
                                       throws JMException
Description copied from interface: MBeanInfoProvider
Get an array of MBeanOperationInfo

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

getObjectToManage

public Object getObjectToManage()
Description copied from interface: MBeanInfoProvider
Get the Object to Manage

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

getType

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

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

setPropertyChangeListener

public void setPropertyChangeListener(PropertyChangeListener l)
Description copied from interface: MBeanInfoProvider
Register for propertyChange events

Specified by:
setPropertyChangeListener in interface MBeanInfoProvider

firePropertyChanged

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

getKey

public String getKey()

fireEvent

protected void fireEvent(int type)


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