Class FixedCountSubscriptionRecoveryPolicy
- java.lang.Object
-
- org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy
-
- All Implemented Interfaces:
SubscriptionRecoveryPolicy
,Service
public class FixedCountSubscriptionRecoveryPolicy extends Object implements SubscriptionRecoveryPolicy
This implementation ofSubscriptionRecoveryPolicy
will keep a fixed count of last messages.
-
-
Constructor Summary
Constructors Constructor Description FixedCountSubscriptionRecoveryPolicy()
-
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.int
getMaximumSize()
void
recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub)
Let a subscription recover message held by the policy.void
setBroker(Broker broker)
void
setMaximumSize(int maximumSize)
Sets the maximum number of messages that this destination will hold around in RAMvoid
start()
void
stop()
-
-
-
Method Detail
-
copy
public SubscriptionRecoveryPolicy copy()
Description copied from interface:SubscriptionRecoveryPolicy
Used to copy the policy object.- Specified by:
copy
in interfaceSubscriptionRecoveryPolicy
- Returns:
- the copy
-
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
-
getMaximumSize
public int getMaximumSize()
-
setMaximumSize
public void setMaximumSize(int maximumSize)
Sets the maximum number of messages that this destination will hold around in RAM
-
browse
public Message[] browse(ActiveMQDestination destination) throws Exception
- Specified by:
browse
in interfaceSubscriptionRecoveryPolicy
- Returns:
- messages
- Throws:
Exception
-
setBroker
public void setBroker(Broker broker)
- Specified by:
setBroker
in interfaceSubscriptionRecoveryPolicy
-
-