Class SimpleMessageListenerContainer
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.component.sjms.consumer.SimpleMessageListenerContainer
-
- All Implemented Interfaces:
AutoCloseable,javax.jms.ExceptionListener,org.apache.camel.AfterPropertiesConfigured,MessageListenerContainer,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
- Direct Known Subclasses:
ExclusiveQueueMessageListenerContainer,TemporaryQueueMessageListenerContainer
public class SimpleMessageListenerContainer extends org.apache.camel.support.service.ServiceSupport implements MessageListenerContainer, javax.jms.ExceptionListener
-
-
Constructor Summary
Constructors Constructor Description SimpleMessageListenerContainer(SjmsEndpoint endpoint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesConfigured(org.apache.camel.CamelContext camelContext)protected voidconfigureConsumer(javax.jms.MessageConsumer consumer, javax.jms.Session session)protected voidcreateConnection()protected javax.jms.MessageConsumercreateMessageConsumer(javax.jms.Session session)protected javax.jms.SessioncreateSession(javax.jms.Connection connection, SjmsEndpoint endpoint)protected voiddoStart()protected voiddoStop()StringgetClientId()intgetConcurrentConsumers()javax.jms.ConnectionFactorygetConnectionFactory()DestinationCreationStrategygetDestinationCreationStrategy()StringgetDestinationName()SjmsEndpointgetEndpoint()protected voidinitConsumers()voidonException(javax.jms.JMSException exception)protected booleanrecoverConnection(org.apache.camel.util.backoff.BackOffTimer.Task task)protected voidrefreshConnection()protected voidscheduleConnectionRecovery()voidsetClientId(String clientId)voidsetConcurrentConsumers(int concurrentConsumers)voidsetDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy)voidsetDestinationName(String destinationName)voidsetExceptionListener(javax.jms.ExceptionListener exceptionListener)voidsetMessageListener(SessionMessageListener messageListener)protected voidstartConnection()protected voidstopConnection()protected voidstopConsumers()-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
SimpleMessageListenerContainer
public SimpleMessageListenerContainer(SjmsEndpoint endpoint)
-
-
Method Detail
-
getEndpoint
public SjmsEndpoint getEndpoint()
-
setMessageListener
public void setMessageListener(SessionMessageListener messageListener)
- Specified by:
setMessageListenerin interfaceMessageListenerContainer
-
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
- Specified by:
setExceptionListenerin interfaceMessageListenerContainer
-
getClientId
public String getClientId()
-
setClientId
public void setClientId(String clientId)
-
getDestinationName
public String getDestinationName()
-
setDestinationName
public void setDestinationName(String destinationName)
-
getDestinationCreationStrategy
public DestinationCreationStrategy getDestinationCreationStrategy()
-
setDestinationCreationStrategy
public void setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy)
-
getConcurrentConsumers
public int getConcurrentConsumers()
-
setConcurrentConsumers
public void setConcurrentConsumers(int concurrentConsumers)
-
afterPropertiesConfigured
public void afterPropertiesConfigured(org.apache.camel.CamelContext camelContext)
- Specified by:
afterPropertiesConfiguredin interfaceorg.apache.camel.AfterPropertiesConfigured
-
getConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()
- Specified by:
getConnectionFactoryin interfaceMessageListenerContainer
-
configureConsumer
protected void configureConsumer(javax.jms.MessageConsumer consumer, javax.jms.Session session) throws Exception- Throws:
Exception
-
onException
public void onException(javax.jms.JMSException exception)
- Specified by:
onExceptionin interfacejavax.jms.ExceptionListener
-
recoverConnection
protected boolean recoverConnection(org.apache.camel.util.backoff.BackOffTimer.Task task) throws Exception- Throws:
Exception
-
scheduleConnectionRecovery
protected void scheduleConnectionRecovery()
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
createSession
protected javax.jms.Session createSession(javax.jms.Connection connection, SjmsEndpoint endpoint) throws Exception- Throws:
Exception
-
createMessageConsumer
protected javax.jms.MessageConsumer createMessageConsumer(javax.jms.Session session) throws Exception- Throws:
Exception
-
stopConsumers
protected void stopConsumers()
-
stopConnection
protected void stopConnection()
-
-