Class LastImageSubscriptionRecoveryPolicy
java.lang.Object
org.apache.activemq.broker.region.policy.LastImageSubscriptionRecoveryPolicy
- All Implemented Interfaces:
SubscriptionRecoveryPolicy,org.apache.activemq.Service
public class LastImageSubscriptionRecoveryPolicy
extends Object
implements SubscriptionRecoveryPolicy
This implementation of
SubscriptionRecoveryPolicy will only keep the
last message.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(ConnectionContext context, org.apache.activemq.broker.region.MessageReference node) A message was sent to the destination.org.apache.activemq.command.Message[]browse(org.apache.activemq.command.ActiveMQDestination destination) copy()Used to copy the policy object.voidrecover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) Let a subscription recover message held by the policy.voidvoidstart()voidstop()
-
Constructor Details
-
LastImageSubscriptionRecoveryPolicy
public LastImageSubscriptionRecoveryPolicy()
-
-
Method Details
-
add
public boolean add(ConnectionContext context, org.apache.activemq.broker.region.MessageReference node) throws Exception Description copied from interface:SubscriptionRecoveryPolicyA message was sent to the destination.- Specified by:
addin interfaceSubscriptionRecoveryPolicy- Returns:
- true if successful
- Throws:
Exception
-
recover
public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception Description copied from interface:SubscriptionRecoveryPolicyLet a subscription recover message held by the policy.- Specified by:
recoverin interfaceSubscriptionRecoveryPolicy- Throws:
Exception
-
start
- Specified by:
startin interfaceorg.apache.activemq.Service- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Throws:
Exception
-
browse
public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination destination) throws Exception - Specified by:
browsein interfaceSubscriptionRecoveryPolicy- Returns:
- messages
- Throws:
Exception
-
copy
Description copied from interface:SubscriptionRecoveryPolicyUsed to copy the policy object.- Specified by:
copyin interfaceSubscriptionRecoveryPolicy- Returns:
- the copy
-
setBroker
- Specified by:
setBrokerin interfaceSubscriptionRecoveryPolicy
-