org.apache.activemq.broker.region.policy
Class FixedCountSubscriptionRecoveryPolicy

java.lang.Object
  extended by org.apache.activemq.broker.region.policy.FixedCountSubscriptionRecoveryPolicy
All Implemented Interfaces:
SubscriptionRecoveryPolicy, Service

public class FixedCountSubscriptionRecoveryPolicy
extends java.lang.Object
implements SubscriptionRecoveryPolicy

This implementation of SubscriptionRecoveryPolicy will keep a fixed count of last messages.

Version:
$Revision$

Constructor Summary
FixedCountSubscriptionRecoveryPolicy()
           
 
Method Summary
 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, Subscription sub)
          Let a subscription recover message held by the policy.
 void setMaximumSize(int maximumSize)
          Sets the maximum number of messages that this destination will hold around in RAM
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedCountSubscriptionRecoveryPolicy

public FixedCountSubscriptionRecoveryPolicy()
Method Detail

copy

public SubscriptionRecoveryPolicy copy()
Description copied from interface: SubscriptionRecoveryPolicy
Used to copy the policy object.

Specified by:
copy in interface SubscriptionRecoveryPolicy

add

public boolean add(ConnectionContext context,
                   MessageReference node)
            throws java.lang.Exception
Description copied from interface: SubscriptionRecoveryPolicy
A message was sent to the destination.

Specified by:
add in interface SubscriptionRecoveryPolicy
Returns:
true if successful
Throws:
java.lang.Exception

recover

public void recover(ConnectionContext context,
                    Topic topic,
                    Subscription sub)
             throws java.lang.Exception
Description copied from interface: SubscriptionRecoveryPolicy
Let a subscription recover message held by the policy.

Specified by:
recover in interface SubscriptionRecoveryPolicy
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Service
Throws:
java.lang.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 java.lang.Exception
Specified by:
browse in interface SubscriptionRecoveryPolicy
Returns:
messages
Throws:
java.lang.Exception


Copyright © 2011 Apache Software Foundation. All Rights Reserved.