org.springframework.integration.dispatcher
Class SimpleDispatcher

java.lang.Object
  extended by org.springframework.integration.dispatcher.AbstractDispatcher
      extended by org.springframework.integration.dispatcher.SimpleDispatcher
All Implemented Interfaces:
MessageDispatcher, MessageTarget

public class SimpleDispatcher
extends AbstractDispatcher

Basic implementation of MessageDispatcher.

Author:
Mark Fisher

Field Summary
static int DEFAULT_REJECTION_LIMIT
           
static long DEFAULT_RETRY_INTERVAL
           
private  int rejectionLimit
           
private  long retryInterval
           
private  boolean shouldFailOnRejectionLimit
           
 
Fields inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
logger, targets
 
Constructor Summary
SimpleDispatcher()
           
 
Method Summary
 boolean send(Message<?> message)
           
 void setRejectionLimit(int rejectionLimit)
          Set the maximum number of retries upon rejection.
 void setRetryInterval(long retryInterval)
          Set the amount of time in milliseconds to wait between rejections.
 void setShouldFailOnRejectionLimit(boolean shouldFailOnRejectionLimit)
          Specify whether an exception should be thrown when this dispatcher's rejectionLimit is reached.
 
Methods inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
addTarget, getTaskExecutor, removeTarget, sendMessageToTarget, setTaskExecutor, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REJECTION_LIMIT

public static final int DEFAULT_REJECTION_LIMIT
See Also:
Constant Field Values

DEFAULT_RETRY_INTERVAL

public static final long DEFAULT_RETRY_INTERVAL
See Also:
Constant Field Values

rejectionLimit

private volatile int rejectionLimit

retryInterval

private volatile long retryInterval

shouldFailOnRejectionLimit

private volatile boolean shouldFailOnRejectionLimit
Constructor Detail

SimpleDispatcher

public SimpleDispatcher()
Method Detail

setRejectionLimit

public void setRejectionLimit(int rejectionLimit)
Set the maximum number of retries upon rejection.


setRetryInterval

public void setRetryInterval(long retryInterval)
Set the amount of time in milliseconds to wait between rejections.


setShouldFailOnRejectionLimit

public void setShouldFailOnRejectionLimit(boolean shouldFailOnRejectionLimit)
Specify whether an exception should be thrown when this dispatcher's rejectionLimit is reached. The default value is 'true'.


send

public boolean send(Message<?> message)