org.apache.servicemix.jbi.framework
Class ComponentMBeanImpl

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.jbi.framework.ComponentMBeanImpl
All Implemented Interfaces:
javax.jbi.management.ComponentLifeCycleMBean, javax.jbi.management.LifeCycleMBean, ComponentMBean, MBeanInfoProvider

public class ComponentMBeanImpl
extends BaseLifeCycle
implements ComponentMBean

Defines basic statistics on the Component


Field Summary
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface org.apache.servicemix.jbi.framework.ComponentMBean
TYPE_BINDING_COMPONENT, TYPE_POJO, TYPE_SERVICE_ENGINE
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
ComponentMBeanImpl(JBIContainer container, ComponentNameSpace name, String description, javax.jbi.component.Component component, boolean binding, boolean service, String[] sharedLibraries)
          Construct with it's id and delivery channel Id
 
Method Summary
 void dispose()
           
 void doShutDown()
          Shut down the item - doesn't persist the state
 void doStart()
          Start the item - doesn't persist the state
 void doStop()
          Stop the item - doesn't persist the state
protected  void fireEvent(int type)
           
 void firePropertyChanged(String name, Object oldValue, Object newValue)
           
 ActivationSpec getActivationSpec()
           
 MBeanAttributeInfo[] getAttributeInfos()
          Get an array of MBeanAttributeInfo
 javax.jbi.component.Component getComponent()
           
 ComponentNameSpace getComponentNameSpace()
           
 String getComponentType()
           
 JBIContainer getContainer()
           
 ComponentContextImpl getContext()
           
 DeliveryChannelImpl getDeliveryChannel()
           
 String getDescription()
          Get the Description of the item
 ObjectName getExtensionMBeanName()
          Get the JMX ObjectName for any additional MBean for this component.
 int getInboundQueueCapacity()
           
 javax.jbi.component.ComponentLifeCycle getLifeCycle()
           
 ObjectName getMBeanName()
           
 String getName()
          Get the name of the item
 MBeanOperationInfo[] getOperationInfos()
          Get an array of MBeanOperationInfo
 String getRunningStateFromStore()
           
 javax.jbi.component.ServiceUnitManager getServiceUnitManager()
           
 String[] getSharedLibraries()
           
 String getSubType()
          Get the type of this mbean
 int getThrottlingInterval()
          Get the interval for throttling - number of Exchanges set before the throttling timeout is applied
 long getThrottlingTimeout()
          Get the throttling timeout
 String getType()
          Get the type of the item
 void init()
          set state to initialized
protected  void initServiceAssemblies()
           
 boolean isBinding()
           
 boolean isEngine()
           
 boolean isExchangeThrottling()
          Is MessageExchange sender throttling enabled ?
 boolean isPojo()
           
 boolean isService()
           
 void persistRunningState()
          Persist the running state
 ObjectName registerMBeans(ManagementContext ctx)
          Register the MBeans for this Component
 void setActivationSpec(ActivationSpec activationSpec)
          Set the ActivationSpec
 void setContext(ComponentContextImpl ctx)
          Set the Context
 void setDeliveryChannel(DeliveryChannelImpl deliveryChannel)
           
 void setExchangeThrottling(boolean value)
          Set message throttling
 void setInboundQueueCapacity(int value)
          Set the inbound queue capacity
 void setInitialRunningState()
          Set the initial running state of the Component
 void setPojo(boolean pojo)
           
 void setShutdownStateAfterInstall()
           
 void setThrottlingInterval(int value)
          Set the throttling interval number of Exchanges set before the throttling timeout is applied
 void setThrottlingTimeout(long value)
          Set the throttling timout
 void shutDown()
          Shut down the item.
protected  void shutDownServiceAssemblies()
           
 void start()
          Start the item.
protected  void startServiceAssemblies()
           
 void stop()
          Stop the item.
protected  void stopServiceAssemblies()
           
 void unregisterMbeans(ManagementContext ctx)
          Unregister Component MBeans
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
getCurrentState, getObjectToManage, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jbi.management.LifeCycleMBean
getCurrentState
 

Constructor Detail

ComponentMBeanImpl

public ComponentMBeanImpl(JBIContainer container,
                          ComponentNameSpace name,
                          String description,
                          javax.jbi.component.Component component,
                          boolean binding,
                          boolean service,
                          String[] sharedLibraries)
Construct with it's id and delivery channel Id

Parameters:
name -
description -
component -
binding -
service -
sharedLibraries -
Method Detail

dispose

public void dispose()

registerMBeans

public ObjectName registerMBeans(ManagementContext ctx)
                          throws javax.jbi.JBIException
Register the MBeans for this Component

Parameters:
ctx -
Returns:
ObjectName
Throws:
javax.jbi.JBIException

unregisterMbeans

public void unregisterMbeans(ManagementContext ctx)
                      throws javax.jbi.JBIException
Unregister Component MBeans

Parameters:
ctx -
Throws:
javax.jbi.JBIException

setContext

public void setContext(ComponentContextImpl ctx)
Set the Context

Parameters:
ctx -

getExtensionMBeanName

public ObjectName getExtensionMBeanName()
Get the JMX ObjectName for any additional MBean for this component. If there is none, return null.

Specified by:
getExtensionMBeanName in interface javax.jbi.management.ComponentLifeCycleMBean
Returns:
ObjectName the JMX object name of the additional MBean or null if there is no additional MBean.

getName

public String getName()
Get the name of the item

Specified by:
getName in interface ComponentMBean
Specified by:
getName in interface MBeanInfoProvider
Overrides:
getName in class BaseLifeCycle
Returns:
the name

getType

public String getType()
Get the type of the item

Specified by:
getType in interface MBeanInfoProvider
Overrides:
getType in class BaseLifeCycle
Returns:
the type

getSubType

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

Specified by:
getSubType in interface MBeanInfoProvider
Overrides:
getSubType in class BaseLifeCycle
Returns:
the type

getDescription

public String getDescription()
Get the Description of the item

Specified by:
getDescription in interface MBeanInfoProvider
Returns:
the description

init

public void init()
          throws javax.jbi.JBIException
Description copied from class: BaseLifeCycle
set state to initialized

Overrides:
init in class BaseLifeCycle
Throws:
javax.jbi.JBIException

start

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

Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class BaseLifeCycle
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
Overrides:
stop in class BaseLifeCycle
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
Overrides:
shutDown in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to shut down.

setShutdownStateAfterInstall

public void setShutdownStateAfterInstall()

doStart

public void doStart()
             throws javax.jbi.JBIException
Start the item - doesn't persist the state

Throws:
javax.jbi.JBIException - if the item fails to start.

doStop

public void doStop()
            throws javax.jbi.JBIException
Stop the item - doesn't persist the state

Throws:
javax.jbi.JBIException - if the item fails to stop.

doShutDown

public void doShutDown()
                throws javax.jbi.JBIException
Shut down the item - doesn't persist the state

Throws:
javax.jbi.JBIException - if the item fails to shut down.

setInitialRunningState

public void setInitialRunningState()
                            throws javax.jbi.JBIException
Set the initial running state of the Component

Throws:
javax.jbi.JBIException

persistRunningState

public void persistRunningState()
Persist the running state


getRunningStateFromStore

public String getRunningStateFromStore()
Returns:
the current running state from disk

getInboundQueueCapacity

public int getInboundQueueCapacity()
Returns:
the capacity of the inbound queue

setInboundQueueCapacity

public void setInboundQueueCapacity(int value)
Set the inbound queue capacity

Parameters:
value -

getDeliveryChannel

public DeliveryChannelImpl getDeliveryChannel()
Returns:
Returns the deliveryChannel.

setDeliveryChannel

public void setDeliveryChannel(DeliveryChannelImpl deliveryChannel)
Parameters:
deliveryChannel - The deliveryChannel to set.

getActivationSpec

public ActivationSpec getActivationSpec()
Returns:
the ActivateionSpec

isPojo

public boolean isPojo()
Returns:
Returns the pojo.

setActivationSpec

public void setActivationSpec(ActivationSpec activationSpec)
Set the ActivationSpec

Parameters:
activationSpec -

isExchangeThrottling

public boolean isExchangeThrottling()
Is MessageExchange sender throttling enabled ?

Specified by:
isExchangeThrottling in interface ComponentMBean
Returns:
true if throttling enabled

setExchangeThrottling

public void setExchangeThrottling(boolean value)
Set message throttling

Specified by:
setExchangeThrottling in interface ComponentMBean
Parameters:
value -

getThrottlingTimeout

public long getThrottlingTimeout()
Get the throttling timeout

Specified by:
getThrottlingTimeout in interface ComponentMBean
Returns:
throttling tomeout (ms)

setThrottlingTimeout

public void setThrottlingTimeout(long value)
Set the throttling timout

Specified by:
setThrottlingTimeout in interface ComponentMBean
Parameters:
value - (ms)

getThrottlingInterval

public int getThrottlingInterval()
Get the interval for throttling - number of Exchanges set before the throttling timeout is applied

Specified by:
getThrottlingInterval in interface ComponentMBean
Returns:
interval for throttling

setThrottlingInterval

public void setThrottlingInterval(int value)
Set the throttling interval number of Exchanges set before the throttling timeout is applied

Specified by:
setThrottlingInterval in interface ComponentMBean
Parameters:
value -

getAttributeInfos

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

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

getOperationInfos

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

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

firePropertyChanged

public void firePropertyChanged(String name,
                                Object oldValue,
                                Object newValue)
Overrides:
firePropertyChanged in class BaseLifeCycle

initServiceAssemblies

protected void initServiceAssemblies()
                              throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

startServiceAssemblies

protected void startServiceAssemblies()
                               throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

stopServiceAssemblies

protected void stopServiceAssemblies()
                              throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

shutDownServiceAssemblies

protected void shutDownServiceAssemblies()
                                  throws javax.jbi.management.DeploymentException
Throws:
javax.jbi.management.DeploymentException

fireEvent

protected void fireEvent(int type)

getLifeCycle

public javax.jbi.component.ComponentLifeCycle getLifeCycle()

getServiceUnitManager

public javax.jbi.component.ServiceUnitManager getServiceUnitManager()

getContainer

public JBIContainer getContainer()

getComponent

public javax.jbi.component.Component getComponent()

getComponentNameSpace

public ComponentNameSpace getComponentNameSpace()

getContext

public ComponentContextImpl getContext()

getMBeanName

public ObjectName getMBeanName()

isBinding

public boolean isBinding()

isService

public boolean isService()

setPojo

public void setPojo(boolean pojo)

isEngine

public boolean isEngine()

getSharedLibraries

public String[] getSharedLibraries()
Returns:
the sharedLibraries

getComponentType

public String getComponentType()
Specified by:
getComponentType in interface ComponentMBean
Returns:
the component type


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.