org.apache.servicemix.common
Class AsyncBaseLifeCycle
java.lang.Object
org.apache.servicemix.common.AsyncBaseLifeCycle
- All Implemented Interfaces:
- ComponentLifeCycle
- Direct Known Subclasses:
- BaseLifeCycle
public class AsyncBaseLifeCycle
- extends Object
- implements ComponentLifeCycle
Base class for life cycle management of components. This class may be used as
is.
- Since:
- 3.0
- Version:
- $Revision: 399873 $
- Author:
- Guillaume Nodet
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INITIALIZED
public static final String INITIALIZED
- See Also:
- Constant Field Values
logger
protected transient Log logger
component
protected ServiceMixComponent component
context
protected ComponentContext context
mbeanName
protected ObjectName mbeanName
executorFactory
protected ExecutorFactory executorFactory
executor
protected Executor executor
running
protected AtomicBoolean running
channel
protected DeliveryChannel channel
poller
protected Thread poller
polling
protected AtomicBoolean polling
transactionManager
protected TransactionManager transactionManager
workManagerCreated
protected boolean workManagerCreated
processors
protected Map<String,ExchangeProcessor> processors
correlationId
protected ThreadLocal<String> correlationId
currentState
protected String currentState
AsyncBaseLifeCycle
public AsyncBaseLifeCycle()
AsyncBaseLifeCycle
public AsyncBaseLifeCycle(ServiceMixComponent component)
setComponent
protected void setComponent(ServiceMixComponent component)
getExtensionMBeanName
public ObjectName getExtensionMBeanName()
- Specified by:
getExtensionMBeanName in interface ComponentLifeCycle
getExtensionMBean
protected Object getExtensionMBean()
throws Exception
- Throws:
Exception
createExtensionMBeanName
protected ObjectName createExtensionMBeanName()
throws Exception
- Throws:
Exception
getEPRServiceName
public QName getEPRServiceName()
getCurrentState
public String getCurrentState()
setCurrentState
protected void setCurrentState(String currentState)
isStarted
public boolean isStarted()
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
init
public void init(ComponentContext context)
throws JBIException
- Specified by:
init in interface ComponentLifeCycle
- Throws:
JBIException
doInit
protected void doInit()
throws Exception
- Throws:
Exception
shutDown
public void shutDown()
throws JBIException
- Specified by:
shutDown in interface ComponentLifeCycle
- Throws:
JBIException
doShutDown
protected void doShutDown()
throws Exception
- Throws:
Exception
start
public void start()
throws JBIException
- Specified by:
start in interface ComponentLifeCycle
- Throws:
JBIException
doStart
protected void doStart()
throws Exception
- Throws:
Exception
pollDeliveryChannel
protected void pollDeliveryChannel()
stop
public void stop()
throws JBIException
- Specified by:
stop in interface ComponentLifeCycle
- Throws:
JBIException
doStop
protected void doStop()
throws Exception
- Throws:
Exception
getContext
public ComponentContext getContext()
- Returns:
- Returns the context.
getExecutor
public Executor getExecutor()
createExecutorFactory
protected ExecutorFactory createExecutorFactory()
findExecutorFactory
protected ExecutorFactory findExecutorFactory()
processExchangeInTx
protected void processExchangeInTx(MessageExchange exchange,
Transaction tx)
exceptionShouldRollbackTx
protected boolean exceptionShouldRollbackTx(Exception e)
processExchange
protected void processExchange(MessageExchange exchange)
throws Exception
- Throws:
Exception
sendConsumerExchange
public void sendConsumerExchange(MessageExchange exchange,
ExchangeProcessor processor)
throws MessagingException
- Deprecated. use sendConsumerExchange(MessageExchange, Endpoint) instead
- Parameters:
exchange - processor -
- Throws:
MessagingException
sendConsumerExchange
public void sendConsumerExchange(MessageExchange exchange,
Endpoint endpoint)
throws MessagingException
- This method allows the component to keep no state in memory so that
components can be clustered and provide fail-over and load-balancing.
- Parameters:
exchange - endpoint -
- Throws:
MessagingException
prepareConsumerExchange
public void prepareConsumerExchange(MessageExchange exchange,
Endpoint endpoint)
getResolvedEPR
protected Endpoint getResolvedEPR(ServiceEndpoint ep)
throws Exception
- Handle an exchange sent to an EPR resolved by this component
- Parameters:
ep - the service endpoint
- Returns:
- an endpoint to use for handling the exchange
- Throws:
Exception
Copyright © 2005-2008. All Rights Reserved.