https://issues.apache.org/jira/browse/AMQ-3205 - Update ActivationSpec, patch applied with thanks

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1079331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2011-03-08 11:52:37 +00:00
parent 373417c0df
commit 8fba621a08
4 changed files with 42 additions and 1 deletions

View File

@ -618,9 +618,20 @@ public class ActiveMQActivationSpec implements MessageActivationSpec, Serializab
/**
*
*/
public void setBackOffMultiplier(short backOffMultiplier) {
public void setBackOffMultiplier(double backOffMultiplier) {
lazyCreateRedeliveryPolicy().setBackOffMultiplier(backOffMultiplier);
}
public long getMaximumRedeliveryDelay() {
if (redeliveryPolicy == null) {
return 0;
}
return redeliveryPolicy.getMaximumRedeliveryDelay();
}
public void setMaximumRedeliveryDelay(long maximumRedeliveryDelay) {
lazyCreateRedeliveryPolicy().setMaximumRedeliveryDelay(maximumRedeliveryDelay);
}
/**
*

View File

@ -205,6 +205,10 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser
return Long.valueOf(redeliveryPolicy().getInitialRedeliveryDelay());
}
public Long getMaximumRedeliveryDelay() {
return Long.valueOf(redeliveryPolicy().getMaximumRedeliveryDelay());
}
public Integer getMaximumRedeliveries() {
return Integer.valueOf(redeliveryPolicy().getMaximumRedeliveries());
}
@ -225,6 +229,12 @@ public class ActiveMQConnectionRequestInfo implements ConnectionRequestInfo, Ser
}
}
public void setMaximumRedeliveryDelay(Long value) {
if (value != null) {
redeliveryPolicy().setMaximumRedeliveryDelay(value.longValue());
}
}
public void setMaximumRedeliveries(Integer value) {
if (value != null) {
redeliveryPolicy().setMaximumRedeliveries(value.intValue());

View File

@ -235,6 +235,24 @@ public class ActiveMQConnectionSupport {
info.setInitialRedeliveryDelay(value);
}
/**
* @return initial redelivery delay
*/
public Long getMaximumRedeliveryDelay() {
return info.getMaximumRedeliveryDelay();
}
/**
* @param value
*/
public void setMaximumRedeliveryDelay(Long value) {
if ( log.isDebugEnabled() ) {
log.debug("setting [maximumRedeliveryDelay] to: " + value);
}
info.setMaximumRedeliveryDelay(value);
}
/**
* @return input stream prefetch
*/

View File

@ -116,6 +116,8 @@ public interface MessageActivationSpec extends ActivationSpec {
String getMaxMessagesPerBatch();
double getBackOffMultiplier();
long getMaximumRedeliveryDelay();
long getInitialRedeliveryDelay();