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 void
afterPropertiesConfigured(org.apache.camel.CamelContext camelContext)
protected void
configureConsumer(javax.jms.MessageConsumer consumer, javax.jms.Session session)
protected void
createConnection()
protected javax.jms.MessageConsumer
createMessageConsumer(javax.jms.Session session)
protected javax.jms.Session
createSession(javax.jms.Connection connection, SjmsEndpoint endpoint)
protected void
doStart()
protected void
doStop()
String
getClientId()
int
getConcurrentConsumers()
javax.jms.ConnectionFactory
getConnectionFactory()
DestinationCreationStrategy
getDestinationCreationStrategy()
String
getDestinationName()
SjmsEndpoint
getEndpoint()
protected void
initConsumers()
void
onException(javax.jms.JMSException exception)
protected boolean
recoverConnection(org.apache.camel.util.backoff.BackOffTimer.Task task)
protected void
refreshConnection()
protected void
scheduleConnectionRecovery()
void
setClientId(String clientId)
void
setConcurrentConsumers(int concurrentConsumers)
void
setDestinationCreationStrategy(DestinationCreationStrategy destinationCreationStrategy)
void
setDestinationName(String destinationName)
void
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
void
setMessageListener(SessionMessageListener messageListener)
protected void
startConnection()
protected void
stopConnection()
protected void
stopConsumers()
-
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:
setMessageListener
in interfaceMessageListenerContainer
-
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
- Specified by:
setExceptionListener
in 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:
afterPropertiesConfigured
in interfaceorg.apache.camel.AfterPropertiesConfigured
-
getConnectionFactory
public javax.jms.ConnectionFactory getConnectionFactory()
- Specified by:
getConnectionFactory
in 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:
onException
in 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:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in 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()
-
-