Class RetainedMessageSubscriptionRecoveryPolicy
- java.lang.Object
-
- org.apache.activemq.broker.region.policy.RetainedMessageSubscriptionRecoveryPolicy
-
- All Implemented Interfaces:
SubscriptionRecoveryPolicy
,Service
public class RetainedMessageSubscriptionRecoveryPolicy extends Object implements SubscriptionRecoveryPolicy
This implementation ofSubscriptionRecoveryPolicy
will only keep the last non-zero length message with theActiveMQMessage
.RETAIN_PROPERTY.
-
-
Field Summary
Fields Modifier and Type Field Description static String
RETAIN_PROPERTY
static String
RETAINED_PROPERTY
-
Constructor Summary
Constructors Constructor Description RetainedMessageSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy wrapped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(ConnectionContext context, MessageReference node)
A message was sent to the destination.Message[]
browse(ActiveMQDestination destination)
SubscriptionRecoveryPolicy
copy()
Used to copy the policy object.SubscriptionRecoveryPolicy
getWrapped()
void
recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub)
Let a subscription recover message held by the policy.void
setBroker(Broker broker)
void
setWrapped(SubscriptionRecoveryPolicy wrapped)
void
start()
void
stop()
-
-
-
Field Detail
-
RETAIN_PROPERTY
public static final String RETAIN_PROPERTY
- See Also:
- Constant Field Values
-
RETAINED_PROPERTY
public static final String RETAINED_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RetainedMessageSubscriptionRecoveryPolicy
public RetainedMessageSubscriptionRecoveryPolicy(SubscriptionRecoveryPolicy wrapped)
-
-
Method Detail
-
add
public boolean add(ConnectionContext context, MessageReference node) throws Exception
Description copied from interface:SubscriptionRecoveryPolicy
A message was sent to the destination.- Specified by:
add
in interfaceSubscriptionRecoveryPolicy
- Returns:
- true if successful
- Throws:
Exception
-
recover
public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception
Description copied from interface:SubscriptionRecoveryPolicy
Let a subscription recover message held by the policy.- Specified by:
recover
in interfaceSubscriptionRecoveryPolicy
- Throws:
Exception
-
start
public void start() throws Exception
-
browse
public Message[] browse(ActiveMQDestination destination) throws Exception
- Specified by:
browse
in interfaceSubscriptionRecoveryPolicy
- Returns:
- messages
- Throws:
Exception
-
copy
public SubscriptionRecoveryPolicy copy()
Description copied from interface:SubscriptionRecoveryPolicy
Used to copy the policy object.- Specified by:
copy
in interfaceSubscriptionRecoveryPolicy
- Returns:
- the copy
-
setBroker
public void setBroker(Broker broker)
- Specified by:
setBroker
in interfaceSubscriptionRecoveryPolicy
-
setWrapped
public void setWrapped(SubscriptionRecoveryPolicy wrapped)
-
getWrapped
public SubscriptionRecoveryPolicy getWrapped()
-
-