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

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

public class FixedSizedSubscriptionRecoveryPolicy
extends Object
implements SubscriptionRecoveryPolicy

This implementation of SubscriptionRecoveryPolicy will keep a fixed amount of memory available in RAM for message history which is evicted in time order.


Constructor Summary
FixedSizedSubscriptionRecoveryPolicy()
           
 
Method Summary
 boolean add(ConnectionContext context, MessageReference message)
          A message was sent to the destination.
 Message[] browse(ActiveMQDestination destination)
           
 SubscriptionRecoveryPolicy copy()
          Used to copy the policy object.
protected  MessageList createMessageList()
           
 MessageList getBuffer()
           
 int getMaximumSize()
           
 boolean isUseSharedBuffer()
           
 void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub)
          Let a subscription recover message held by the policy.
 void setBroker(Broker broker)
           
 void setBuffer(MessageList buffer)
           
 void setMaximumSize(int maximumSize)
          Sets the maximum amount of RAM in bytes that this buffer can hold in RAM
 void setUseSharedBuffer(boolean useSharedBuffer)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedSizedSubscriptionRecoveryPolicy

public FixedSizedSubscriptionRecoveryPolicy()
Method Detail

copy

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

Specified by:
copy in interface SubscriptionRecoveryPolicy
Returns:
the copy

add

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

Specified by:
add in interface SubscriptionRecoveryPolicy
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 interface SubscriptionRecoveryPolicy
Throws:
Exception

start

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

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

getBuffer

public MessageList getBuffer()

setBuffer

public void setBuffer(MessageList buffer)

getMaximumSize

public int getMaximumSize()

setMaximumSize

public void setMaximumSize(int maximumSize)
Sets the maximum amount of RAM in bytes that this buffer can hold in RAM


isUseSharedBuffer

public boolean isUseSharedBuffer()

setUseSharedBuffer

public void setUseSharedBuffer(boolean useSharedBuffer)

browse

public Message[] browse(ActiveMQDestination destination)
                 throws Exception
Specified by:
browse in interface SubscriptionRecoveryPolicy
Returns:
messages
Throws:
Exception

setBroker

public void setBroker(Broker broker)
Specified by:
setBroker in interface SubscriptionRecoveryPolicy

createMessageList

protected MessageList createMessageList()


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.