made it easy to copy a RedeliveryPolicy

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@366151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-01-05 10:43:17 +00:00
parent 45ea6c629b
commit c5b3802c61
1 changed files with 20 additions and 33 deletions

View File

@ -16,73 +16,60 @@
*/ */
package org.apache.activemq; package org.apache.activemq;
import org.apache.activemq.command.CommandTypes;
import org.apache.activemq.command.DataStructure;
/** /**
* Configuration options used to control how messages are re-delivered when * Configuration options used to control how messages are re-delivered when they
* they are rolled back. * are rolled back.
* *
* @openwire:marshaller
* @version $Revision: 1.11 $ * @version $Revision: 1.11 $
*/ */
public class RedeliveryPolicy implements DataStructure { public class RedeliveryPolicy implements Cloneable {
public static final byte DATA_STRUCTURE_TYPE=CommandTypes.REDELIVERY_POLICY;
protected int maximumRedeliveries = 5; protected int maximumRedeliveries = 5;
protected long initialRedeliveryDelay = 1000L; protected long initialRedeliveryDelay = 1000L;
protected boolean useExponentialBackOff = false; protected boolean useExponentialBackOff = false;
protected short backOffMultiplier = 5; protected short backOffMultiplier = 5;
public RedeliveryPolicy() { public RedeliveryPolicy() {
} }
public byte getDataStructureType() { public RedeliveryPolicy copy() {
return DATA_STRUCTURE_TYPE; try {
return (RedeliveryPolicy) clone();
}
catch (CloneNotSupportedException e) {
throw new RuntimeException("Could not clone: " + e, e);
}
} }
/**
* @openwire:property version=1 cache=false
*/
public short getBackOffMultiplier() { public short getBackOffMultiplier() {
return backOffMultiplier; return backOffMultiplier;
} }
public void setBackOffMultiplier(short backOffMultiplier) { public void setBackOffMultiplier(short backOffMultiplier) {
this.backOffMultiplier = backOffMultiplier; this.backOffMultiplier = backOffMultiplier;
} }
/**
* @openwire:property version=1 cache=false
*/
public long getInitialRedeliveryDelay() { public long getInitialRedeliveryDelay() {
return initialRedeliveryDelay; return initialRedeliveryDelay;
} }
public void setInitialRedeliveryDelay(long initialRedeliveryDelay) { public void setInitialRedeliveryDelay(long initialRedeliveryDelay) {
this.initialRedeliveryDelay = initialRedeliveryDelay; this.initialRedeliveryDelay = initialRedeliveryDelay;
} }
/**
* @openwire:property version=1 cache=false
*/
public int getMaximumRedeliveries() { public int getMaximumRedeliveries() {
return maximumRedeliveries; return maximumRedeliveries;
} }
public void setMaximumRedeliveries(int maximumRedeliveries) { public void setMaximumRedeliveries(int maximumRedeliveries) {
this.maximumRedeliveries = maximumRedeliveries; this.maximumRedeliveries = maximumRedeliveries;
} }
/**
* @openwire:property version=1 cache=false
*/
public boolean isUseExponentialBackOff() { public boolean isUseExponentialBackOff() {
return useExponentialBackOff; return useExponentialBackOff;
} }
public void setUseExponentialBackOff(boolean useExponentialBackOff) { public void setUseExponentialBackOff(boolean useExponentialBackOff) {
this.useExponentialBackOff = useExponentialBackOff; this.useExponentialBackOff = useExponentialBackOff;
} }
public boolean isMarshallAware() {
return false;
}
} }