org.springframework.jms.listener
Class DefaultMessageListenerContainer.AsyncMessageListenerInvoker

java.lang.Object
  extended by org.springframework.jms.listener.DefaultMessageListenerContainer.AsyncMessageListenerInvoker
All Implemented Interfaces:
java.lang.Runnable, SchedulingAwareRunnable
Enclosing class:
DefaultMessageListenerContainer

private class DefaultMessageListenerContainer.AsyncMessageListenerInvoker
extends java.lang.Object
implements SchedulingAwareRunnable

Runnable that performs looped MessageConsumer.receive() calls.


Field Summary
private  MessageConsumer consumer
           
private  boolean idle
           
private  int idleTaskExecutionCount
           
private  boolean lastMessageSucceeded
           
private  java.lang.Object lastRecoveryMarker
           
private  Session session
           
 
Constructor Summary
private DefaultMessageListenerContainer.AsyncMessageListenerInvoker()
           
 
Method Summary
private  void clearResources()
           
private  void decreaseActiveInvokerCount()
           
private  boolean executeOngoingLoop()
           
private  void initResourcesIfNecessary()
           
private  boolean invokeListener()
           
 boolean isIdle()
           
 boolean isLongLived()
          Return whether the Runnable's operation is long-lived (true) versus short-lived (false).
 void run()
           
 void setIdle(boolean idle)
           
private  void updateRecoveryMarker()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

private Session session

consumer

private MessageConsumer consumer

lastRecoveryMarker

private java.lang.Object lastRecoveryMarker

lastMessageSucceeded

private boolean lastMessageSucceeded

idleTaskExecutionCount

private int idleTaskExecutionCount

idle

private volatile boolean idle
Constructor Detail

DefaultMessageListenerContainer.AsyncMessageListenerInvoker

private DefaultMessageListenerContainer.AsyncMessageListenerInvoker()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

executeOngoingLoop

private boolean executeOngoingLoop()
                            throws JMSException
Throws:
JMSException

invokeListener

private boolean invokeListener()
                        throws JMSException
Throws:
JMSException

decreaseActiveInvokerCount

private void decreaseActiveInvokerCount()

initResourcesIfNecessary

private void initResourcesIfNecessary()
                               throws JMSException
Throws:
JMSException

updateRecoveryMarker

private void updateRecoveryMarker()

clearResources

private void clearResources()

isLongLived

public boolean isLongLived()
Description copied from interface: SchedulingAwareRunnable
Return whether the Runnable's operation is long-lived (true) versus short-lived (false).

In the former case, the task will not allocate a thread from the thread pool (if any) but rather be considered as long-running background thread.

This should be considered a hint. Of course TaskExecutor implementations are free to ignore this flag and the SchedulingAwareRunnable interface overall.

Specified by:
isLongLived in interface SchedulingAwareRunnable

setIdle

public void setIdle(boolean idle)

isIdle

public boolean isIdle()