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

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

public class QueryBasedSubscriptionRecoveryPolicy
extends java.lang.Object
implements SubscriptionRecoveryPolicy

This implementation of SubscriptionRecoveryPolicy will perform a user specific query mechanism to load any messages they may have missed.


Constructor Summary
QueryBasedSubscriptionRecoveryPolicy()
           
 
Method Summary
 boolean add(ConnectionContext context, MessageReference message)
          A message was sent to the destination.
 Message[] browse(ActiveMQDestination dest)
           
protected  void configure(ActiveMQMessage msg)
           
 SubscriptionRecoveryPolicy copy()
          Used to copy the policy object.
protected  ProducerId createProducerId()
           
protected  void dispatchInitialMessage(javax.jms.Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub)
           
 MessageQuery getQuery()
           
 void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub)
          Let a subscription recover message held by the policy.
 void setBroker(Broker broker)
           
 void setQuery(MessageQuery query)
          Sets the query strategy to load initial messages
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBasedSubscriptionRecoveryPolicy

public QueryBasedSubscriptionRecoveryPolicy()
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 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,
                    SubscriptionRecovery 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

getQuery

public MessageQuery getQuery()

setQuery

public void setQuery(MessageQuery query)
Sets the query strategy to load initial messages


browse

public Message[] browse(ActiveMQDestination dest)
                 throws java.lang.Exception
Specified by:
browse in interface SubscriptionRecoveryPolicy
Returns:
messages
Throws:
java.lang.Exception

setBroker

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

dispatchInitialMessage

protected void dispatchInitialMessage(javax.jms.Message message,
                                      Destination regionDestination,
                                      ConnectionContext context,
                                      SubscriptionRecovery sub)

configure

protected void configure(ActiveMQMessage msg)
                  throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createProducerId

protected ProducerId createProducerId()


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.