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, DefaultComponent
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
correlationId
protected ThreadLocal<String> correlationId
currentState
protected String currentState
container
protected Container container
knownExchanges
protected Map<String,Set<String>> knownExchanges
AsyncBaseLifeCycle
public AsyncBaseLifeCycle()
AsyncBaseLifeCycle
public AsyncBaseLifeCycle(ServiceMixComponent component)
getContainer
public Container getContainer()
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()
setExecutor
public void setExecutor(org.apache.servicemix.executors.Executor executor)
getExecutorFactory
public org.apache.servicemix.executors.ExecutorFactory getExecutorFactory()
setExecutorFactory
public void setExecutorFactory(org.apache.servicemix.executors.ExecutorFactory executorFactory)
createExecutorFactory
protected org.apache.servicemix.executors.ExecutorFactory createExecutorFactory()
getSmx3Container
public Object getSmx3Container()
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)
onMessageExchange
public void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
processExchange
protected void processExchange(javax.jbi.messaging.MessageExchange exchange)
throws Exception
- Throws:
Exception
prepareExchange
public void prepareExchange(javax.jbi.messaging.MessageExchange exchange,
Endpoint endpoint)
throws javax.jbi.messaging.MessagingException
- Throws:
javax.jbi.messaging.MessagingException
prepareShutdown
public void prepareShutdown(Endpoint endpoint)
throws InterruptedException
- Throws:
InterruptedException
getKnownExchanges
protected Set<String> getKnownExchanges(Endpoint endpoint)
handleExchange
public void handleExchange(Endpoint endpoint,
javax.jbi.messaging.MessageExchange exchange,
boolean add)
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-2008 Apache Software Foundation. All Rights Reserved.