org.springframework.integration.dispatcher
Class DispatcherPolicy

java.lang.Object
  extended by org.springframework.integration.dispatcher.DispatcherPolicy

public class DispatcherPolicy
extends java.lang.Object

Metadata for a MessageDispatcher.

Author:
Mark Fisher

Field Summary
static int DEFAULT_MAX_MESSAGES_PER_TASK
           
static long DEFAULT_RECEIVE_TIMEOUT
           
static int DEFAULT_REJECTION_LIMIT
           
static long DEFAULT_RETRY_INTERVAL
           
 
Constructor Summary
DispatcherPolicy()
           
DispatcherPolicy(boolean publishSubscribe)
          Create a DispatcherPolicy.
 
Method Summary
 int getMaxMessagesPerTask()
          Return the maximum number of messages for each retrieval attempt.
 long getReceiveTimeout()
          Return the maximum amount of time in milliseconds to wait for a message to be available.
 int getRejectionLimit()
          Return the maximum number of retries upon rejection.
 long getRetryInterval()
          Return the amount of time in milliseconds to wait between rejections.
 boolean getShouldFailOnRejectionLimit()
          Return whether an exception should be thrown when this dispatcher's rejectionLimit is reached.
 boolean isPublishSubscribe()
          Return whether the dispatcher should attempt to publish to all of its handlers.
 void setMaxMessagesPerTask(int maxMessagesPerTask)
          Set the maximum number of messages for each retrieval attempt.
 void setReceiveTimeout(long receiveTimeout)
          Set the maximum amount of time in milliseconds to wait for a message to be available.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_MESSAGES_PER_TASK

public static final int DEFAULT_MAX_MESSAGES_PER_TASK
See Also:
Constant Field Values

DEFAULT_RECEIVE_TIMEOUT

public static final long DEFAULT_RECEIVE_TIMEOUT
See Also:
Constant Field Values

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
Constructor Detail

DispatcherPolicy

public DispatcherPolicy()

DispatcherPolicy

public DispatcherPolicy(boolean publishSubscribe)
Create a DispatcherPolicy.

Parameters:
publishSubscribe - whether the dispatcher should attempt to publish to all of its subscribed handlers. If 'false' it will attempt to send to a single handler (point-to-point).
Method Detail

isPublishSubscribe

public boolean isPublishSubscribe()
Return whether the dispatcher should attempt to publish to all of its handlers. This property is immutable.


getMaxMessagesPerTask

public int getMaxMessagesPerTask()
Return the maximum number of messages for each retrieval attempt.


setMaxMessagesPerTask

public void setMaxMessagesPerTask(int maxMessagesPerTask)
Set the maximum number of messages for each retrieval attempt.


getReceiveTimeout

public long getReceiveTimeout()
Return the maximum amount of time in milliseconds to wait for a message to be available.


setReceiveTimeout

public void setReceiveTimeout(long receiveTimeout)
Set the maximum amount of time in milliseconds to wait for a message to be available.


getRejectionLimit

public int getRejectionLimit()
Return the maximum number of retries upon rejection.


setRejectionLimit

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


getRetryInterval

public long getRetryInterval()
Return the amount of time in milliseconds to wait between rejections.


setRetryInterval

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


getShouldFailOnRejectionLimit

public boolean getShouldFailOnRejectionLimit()
Return whether an exception should be thrown when this dispatcher's rejectionLimit is reached.


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'.