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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(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.void
recover
(ConnectionContext context, Topic topic, SubscriptionRecovery sub) Let a subscription recover message held by the policy.void
void
start()
void
stop()
-
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: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
- Specified by:
start
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceorg.apache.activemq.Service
- Throws:
Exception
-
browse
public org.apache.activemq.command.Message[] browse(org.apache.activemq.command.ActiveMQDestination destination) throws Exception - Specified by:
browse
in interfaceSubscriptionRecoveryPolicy
- Returns:
- messages
- Throws:
Exception
-
copy
Description copied from interface:SubscriptionRecoveryPolicy
Used to copy the policy object.- Specified by:
copy
in interfaceSubscriptionRecoveryPolicy
- Returns:
- the copy
-
setBroker
- Specified by:
setBroker
in interfaceSubscriptionRecoveryPolicy
-