org.apache.servicemix.common
Class AsyncBaseLifeCycle
java.lang.Object
org.apache.servicemix.common.AsyncBaseLifeCycle
- All Implemented Interfaces:
- javax.jbi.component.ComponentLifeCycle
- Direct Known Subclasses:
- BaseLifeCycle
public class AsyncBaseLifeCycle
- extends Object
- implements javax.jbi.component.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 javax.jbi.component.ComponentContext context
mbeanName
protected ObjectName mbeanName
executorFactory
protected org.apache.servicemix.executors.ExecutorFactory executorFactory
executor
protected org.apache.servicemix.executors.Executor executor
running
protected AtomicBoolean running
channel
protected javax.jbi.messaging.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 javax.jbi.component.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(javax.jbi.component.ComponentContext context)
throws javax.jbi.JBIException
- Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
- Throws:
javax.jbi.JBIException
doInit
protected void doInit()
throws Exception
- Throws:
Exception
shutDown
public void shutDown()
throws javax.jbi.JBIException
- Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
- Throws:
javax.jbi.JBIException
doShutDown
protected void doShutDown()
throws Exception
- Throws:
Exception
start
public void start()
throws javax.jbi.JBIException
- Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
- Throws:
javax.jbi.JBIException
doStart
protected void doStart()
throws Exception
- Throws:
Exception
pollDeliveryChannel
protected void pollDeliveryChannel()
stop
public void stop()
throws javax.jbi.JBIException
- Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
- Throws:
javax.jbi.JBIException
doStop
protected void doStop()
throws Exception
- Throws:
Exception
getContext
public javax.jbi.component.ComponentContext getContext()
- Returns:
- Returns the context.
getExecutor
public org.apache.servicemix.executors.Executor getExecutor()
createExecutorFactory
protected org.apache.servicemix.executors.ExecutorFactory createExecutorFactory()
findExecutorFactory
protected org.apache.servicemix.executors.ExecutorFactory findExecutorFactory()
processExchangeInTx
protected void processExchangeInTx(javax.jbi.messaging.MessageExchange exchange,
Transaction tx)
exceptionShouldRollbackTx
protected boolean exceptionShouldRollbackTx(Exception e)
processExchange
protected void processExchange(javax.jbi.messaging.MessageExchange exchange)
throws Exception
- Throws:
Exception
sendConsumerExchange
public void sendConsumerExchange(javax.jbi.messaging.MessageExchange exchange,
ExchangeProcessor processor)
throws javax.jbi.messaging.MessagingException
- Deprecated. use sendConsumerExchange(MessageExchange, Endpoint) instead
- Parameters:
exchange - processor -
- Throws:
javax.jbi.messaging.MessagingException
sendConsumerExchange
public void sendConsumerExchange(javax.jbi.messaging.MessageExchange exchange,
Endpoint endpoint)
throws javax.jbi.messaging.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:
javax.jbi.messaging.MessagingException
prepareConsumerExchange
public void prepareConsumerExchange(javax.jbi.messaging.MessageExchange exchange,
Endpoint endpoint)
getResolvedEPR
protected Endpoint getResolvedEPR(javax.jbi.servicedesc.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-2007 Apache Software Foundation. All Rights Reserved.