| org.springframework.jms.listener.AbstractJmsListeningContainer org.springframework.jms.listener.AbstractMessageListenerContainer org.springframework.jms.listener.AbstractPollingMessageListenerContainer
All known Subclasses: org.springframework.jms.listener.DefaultMessageListenerContainer,
Method Summary | |
protected MessageConsumer | createConsumer(Session session, Destination destination) Create a JMS MessageConsumer for the given Session and Destination. | protected MessageConsumer | createListenerConsumer(Session session) Create a MessageConsumer for the given JMS Session,
registering a MessageListener for the specified listener. | protected boolean | doReceiveAndExecute(Session session, MessageConsumer consumer, TransactionStatus status) Actually execute the listener for a message received from the given consumer,
fetching all requires resources and invoking the listener. | protected Connection | getConnection(JmsResourceHolder holder) Fetch an appropriate Connection from the given JmsResourceHolder. | protected Session | getSession(JmsResourceHolder holder) Fetch an appropriate Session from the given JmsResourceHolder. | final protected PlatformTransactionManager | getTransactionManager() Return the Spring PlatformTransactionManager to use for transactional
wrapping of message reception plus listener execution. | public void | initialize() | protected boolean | isPubSubNoLocal() Return whether to inhibit the delivery of messages published by its own connection. | protected boolean | isSessionLocallyTransacted(Session session) This implementation checks whether the Session is externally synchronized. | protected void | messageReceived(Message message, Session session) Template method that gets called right when a new message has been received,
before attempting to process it. | protected boolean | receiveAndExecute(Session session, MessageConsumer consumer) Execute the listener for a message received from the given consumer,
wrapping the entire operation in an external transaction if demanded. | protected Message | receiveMessage(MessageConsumer consumer) Receive a message from the given consumer. | public void | setPubSubNoLocal(boolean pubSubNoLocal) Set whether to inhibit the delivery of messages published by its own connection. | public void | setReceiveTimeout(long receiveTimeout) Set the timeout to use for receive calls, in milliseconds.
The default is 1000 ms, that is, 1 second.
NOTE: This value needs to be smaller than the transaction
timeout used by the transaction manager (in the appropriate unit,
of course). | public void | setSessionTransacted(boolean sessionTransacted) | public void | setTransactionManager(PlatformTransactionManager transactionManager) Specify the Spring
org.springframework.transaction.PlatformTransactionManager to use for transactional wrapping of message reception plus listener execution.
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
AbstractPollingMessageListenerContainer.setSessionTransacted "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. | public void | setTransactionName(String transactionName) Specify the transaction name to use for transactional wrapping. | public void | setTransactionTimeout(int transactionTimeout) Specify the transaction timeout to use for transactional wrapping, in seconds. |
DEFAULT_RECEIVE_TIMEOUT | final public static long DEFAULT_RECEIVE_TIMEOUT(Code) | | The default receive timeout: 1000 ms = 1 second.
|
createConsumer | protected MessageConsumer createConsumer(Session session, Destination destination) throws JMSException(Code) | | Create a JMS MessageConsumer for the given Session and Destination.
This implementation uses JMS 1.1 API.
Parameters: session - the JMS Session to create a MessageConsumer for Parameters: destination - the JMS Destination to create a MessageConsumer for the new JMS MessageConsumer throws: javax.jms.JMSException - if thrown by JMS API methods |
createListenerConsumer | protected MessageConsumer createListenerConsumer(Session session) throws JMSException(Code) | | Create a MessageConsumer for the given JMS Session,
registering a MessageListener for the specified listener.
Parameters: session - the JMS Session to work on the MessageConsumer throws: javax.jms.JMSException - if thrown by JMS methods See Also: AbstractPollingMessageListenerContainer.receiveAndExecute |
doReceiveAndExecute | protected boolean doReceiveAndExecute(Session session, MessageConsumer consumer, TransactionStatus status) throws JMSException(Code) | | Actually execute the listener for a message received from the given consumer,
fetching all requires resources and invoking the listener.
Parameters: session - the JMS Session to work on Parameters: consumer - the MessageConsumer to work on Parameters: status - the TransactionStatus (may be null ) whether a message has been received throws: JMSException - if thrown by JMS methods See Also: AbstractPollingMessageListenerContainer.doExecuteListener(javax.jms.Session,javax.jms.Message) |
getConnection | protected Connection getConnection(JmsResourceHolder holder)(Code) | | Fetch an appropriate Connection from the given JmsResourceHolder.
This implementation accepts any JMS 1.1 Connection.
Parameters: holder - the JmsResourceHolder an appropriate Connection fetched from the holder,or null if none found |
getSession | protected Session getSession(JmsResourceHolder holder)(Code) | | Fetch an appropriate Session from the given JmsResourceHolder.
This implementation accepts any JMS 1.1 Session.
Parameters: holder - the JmsResourceHolder an appropriate Session fetched from the holder,or null if none found |
getTransactionManager | final protected PlatformTransactionManager getTransactionManager()(Code) | | Return the Spring PlatformTransactionManager to use for transactional
wrapping of message reception plus listener execution.
|
initialize | public void initialize()(Code) | | |
isPubSubNoLocal | protected boolean isPubSubNoLocal()(Code) | | Return whether to inhibit the delivery of messages published by its own connection.
|
messageReceived | protected void messageReceived(Message message, Session session)(Code) | | Template method that gets called right when a new message has been received,
before attempting to process it. Allows subclasses to react to the event
of an actual incoming message, for example adapting their consumer count.
Parameters: message - the received message Parameters: session - the receiving JMS Session |
receiveAndExecute | protected boolean receiveAndExecute(Session session, MessageConsumer consumer) throws JMSException(Code) | | Execute the listener for a message received from the given consumer,
wrapping the entire operation in an external transaction if demanded.
Parameters: session - the JMS Session to work on Parameters: consumer - the MessageConsumer to work on whether a message has been received throws: JMSException - if thrown by JMS methods See Also: AbstractPollingMessageListenerContainer.doReceiveAndExecute |
receiveMessage | protected Message receiveMessage(MessageConsumer consumer) throws JMSException(Code) | | Receive a message from the given consumer.
Parameters: consumer - the MessageConsumer to use the Message, or null if none throws: JMSException - if thrown by JMS methods |
setPubSubNoLocal | public void setPubSubNoLocal(boolean pubSubNoLocal)(Code) | | Set whether to inhibit the delivery of messages published by its own connection.
Default is "false".
See Also: javax.jms.TopicSession.createSubscriber(javax.jms.TopicStringboolean) |
setReceiveTimeout | public void setReceiveTimeout(long receiveTimeout)(Code) | | Set the timeout to use for receive calls, in milliseconds.
The default is 1000 ms, that is, 1 second.
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.
See Also: javax.jms.MessageConsumer.receive(long) See Also: javax.jms.MessageConsumer.receive See Also: AbstractPollingMessageListenerContainer.setTransactionTimeout |
setSessionTransacted | public void setSessionTransacted(boolean sessionTransacted)(Code) | | |
|
|