java.lang.Objectorg.springframework.jms.support.JmsAccessor
org.springframework.jms.support.destination.JmsDestinationAccessor
org.springframework.jms.listener.AbstractJmsListeningContainer
org.springframework.jms.listener.AbstractMessageListenerContainer
org.springframework.jms.listener.AbstractPollingMessageListenerContainer
All Implemented Interfaces:
BeanNameAware, DisposableBean, Lifecycle, InitializingBean
Direct Known Subclasses:
DefaultMessageListenerContainer, DefaultMessageListenerContainer102
This listener container variant is built for repeated polling attempts, each invoking the #receiveAndExecute method. The MessageConsumer used may be reobtained fo reach attempt or cached inbetween attempts; this is up to the concrete implementation. The receive timeout for each attempt can be configured through the "receiveTimeout" property.
The underlying mechanism is based on standard JMS MessageConsumer handling,
which is perfectly compatible with both native JMS and JMS in a J2EE environment.
Neither the JMS MessageConsumer.setMessageListener facility
nor the JMS ServerSessionPool facility is required. A further advantage
of this approach is full control over the listening process, allowing for
custom scaling and throttling and of concurrent message processing
(which is up to concrete subclasses).
Message reception and listener execution can automatically be wrapped in transactions through passing a Spring org.springframework.transaction.PlatformTransactionManager into the "transactionManager" property. This will usually be a org.springframework.transaction.jta.JtaTransactionManager in a J2EE enviroment, in combination with a JTA-aware JMS ConnectionFactory obtained from JNDI (check your J2EE server's documentation).
This base class does not assume any specific mechanism for asynchronous execution of polling invokers. Check out DefaultMessageListenerContainer for a concrete implementation which is based on Spring's org.springframework.core.task.TaskExecutor abstraction, including dynamic scaling of concurrent consumers and automatic self recovery.
Juergen - Hoeller2.0.3 - | Field Summary | ||
|---|---|---|
| public static final long | DEFAULT_RECEIVE_TIMEOUT | The default receive timeout: 1000 ms = 1 second. |
| Fields inherited from org.springframework.jms.listener.AbstractJmsListeningContainer: |
|---|
| sharedConnectionMonitor, lifecycleMonitor |
| Fields inherited from org.springframework.jms.support.JmsAccessor: |
|---|
| logger |
| Method from org.springframework.jms.listener.AbstractPollingMessageListenerContainer Summary: |
|---|
| createConsumer, createListenerConsumer, doReceiveAndExecute, getConnection, getSession, getTransactionManager, initialize, isPubSubNoLocal, isSessionLocallyTransacted, messageReceived, noMessageReceived, receiveAndExecute, receiveMessage, setPubSubNoLocal, setReceiveTimeout, setSessionTransacted, setTransactionManager, setTransactionName, setTransactionTimeout |
| Methods from org.springframework.jms.listener.AbstractJmsListeningContainer: |
|---|
| afterPropertiesSet, createSharedConnection, destroy, doInitialize, doRescheduleTask, doShutdown, doStart, doStop, establishSharedConnection, getBeanName, getClientId, getPausedTaskCount, getSharedConnection, initialize, isActive, isRunning, logRejectedTask, prepareSharedConnection, refreshSharedConnection, rescheduleTaskIfNecessary, resumePausedTasks, runningAllowed, setAutoStartup, setBeanName, setClientId, sharedConnectionEnabled, shutdown, start, startSharedConnection, stop, stopSharedConnection, validateConfiguration |
| Methods from org.springframework.jms.support.destination.JmsDestinationAccessor: |
|---|
| getDestinationResolver, isPubSubDomain, resolveDestinationName, setDestinationResolver, setPubSubDomain |
| Methods from org.springframework.jms.support.JmsAccessor: |
|---|
| afterPropertiesSet, convertJmsAccessException, createConnection, createSession, getConnectionFactory, getSessionAcknowledgeMode, isClientAcknowledge, isSessionTransacted, setConnectionFactory, setSessionAcknowledgeMode, setSessionAcknowledgeModeName, setSessionTransacted |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.jms.listener.AbstractPollingMessageListenerContainer Detail: |
|---|
This implementation uses JMS 1.1 API. |
|
|
This implementation accepts any JMS 1.1 Connection. |
This implementation accepts any JMS 1.1 Session. |
|
|
|
|
|
|
|
|
|
NOTE: This value needs to be smaller than the transaction timeout used by the transaction manager (in the appropriate unit, of course). -1 indicates no timeout at all; however, this is only feasible if not running within a transaction manager. |
|
Default is none, not performing any transactional wrapping. If specified, this will usually be a Spring org.springframework.transaction.jta.JtaTransactionManager or one of its subclasses, in combination with a JTA-aware ConnectionFactory that this message listener container obtains its Connections from. Note: Consider the use of local JMS transactions instead. Simply switch the "sessionTransacted" flag to "true" in order to use a locally transacted JMS Session for the entire receive processing, including any Session operations performed by a SessionAwareMessageListener (e.g. sending a response message). Alternatively, a org.springframework.jms.connection.JmsTransactionManager may be used for fully synchronized Spring transactions based on local JMS transactions. Check AbstractMessageListenerContainer 's javadoc for a discussion of transaction choices and message redelivery scenarios. |
|
|