org.apache.activemq.broker.region
Class DestinationFilter

java.lang.Object
  extended by org.apache.activemq.broker.region.DestinationFilter
All Implemented Interfaces:
Destination, Service, Task
Direct Known Subclasses:
CompositeDestinationFilter, VirtualTopicInterceptor

public class DestinationFilter
extends Object
implements Destination

Version:
$Revision: 74923 $

Field Summary
 
Fields inherited from interface org.apache.activemq.broker.region.Destination
DEFAULT_DEAD_LETTER_STRATEGY
 
Constructor Summary
DestinationFilter(Destination next)
           
 
Method Summary
 void acknowledge(ConnectionContext context, Subscription sub, MessageAck ack, MessageReference node)
           
 void addProducer(ConnectionContext context, ProducerInfo info)
           
 void addSubscription(ConnectionContext context, Subscription sub)
           
 Message[] browse()
           
 void dispose(ConnectionContext context)
           
 void fastProducer(ConnectionContext context, ProducerInfo producerInfo)
          Called to notify a producer is too fast
 void gc()
           
 ActiveMQDestination getActiveMQDestination()
           
 List<Subscription> getConsumers()
           
 DeadLetterStrategy getDeadLetterStrategy()
           
 DestinationStatistics getDestinationStatistics()
           
 int getMaxAuditDepth()
           
 int getMaxBrowsePageSize()
           
 int getMaxPageSize()
           
 int getMaxProducersToAudit()
           
 MemoryUsage getMemoryUsage()
           
 MessageStore getMessageStore()
           
 int getMinimumMessageSize()
           
 String getName()
           
 boolean isActive()
           
 boolean isEnableAudit()
           
 void isFull(ConnectionContext context, Usage usage)
          Called when a Usage reaches a limit
 boolean isLazyDispatch()
           
 boolean isProducerFlowControl()
           
 boolean isUseCache()
           
 boolean iterate()
           
 void messageConsumed(ConnectionContext context, MessageReference messageReference)
          called when message is consumed
 void messageDelivered(ConnectionContext context, MessageReference messageReference)
          Called when message is delivered to the broker
 void messageDiscarded(ConnectionContext context, MessageReference messageReference)
          Called when a message is discarded - e.g.
 void messageExpired(ConnectionContext context, PrefetchSubscription prefetchSubscription, MessageReference node)
           
 void messageExpired(ConnectionContext context, Subscription subs, MessageReference node)
          Inform the Destination a message has expired
 void processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
          called on Queues in slave mode to allow dispatch to follow subscription choice of master
 void removeProducer(ConnectionContext context, ProducerInfo info)
           
 void removeSubscription(ConnectionContext context, Subscription sub, long lastDeliveredSequenceId)
           
 void send(ProducerBrokerExchange context, Message messageSend)
           
protected  void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination)
          Sends a message to the given destination which may be a wildcard
 void setEnableAudit(boolean enableAudit)
           
 void setLazyDispatch(boolean value)
          set the lazy dispatch - default is false
 void setMaxAuditDepth(int maxAuditDepth)
           
 void setMaxBrowsePageSize(int maxPageSize)
           
 void setMaxPageSize(int maxPageSize)
           
 void setMaxProducersToAudit(int maxProducersToAudit)
           
 void setMinimumMessageSize(int minimumMessageSize)
           
 void setProducerFlowControl(boolean value)
           
 void setUseCache(boolean useCache)
           
 void slowConsumer(ConnectionContext context, Subscription subs)
          Called when there is a slow consumer
 void start()
           
 void stop()
           
 void wakeup()
          optionally called by a Subscriber - to inform the Destination its ready for more messages
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DestinationFilter

public DestinationFilter(Destination next)
Method Detail

acknowledge

public void acknowledge(ConnectionContext context,
                        Subscription sub,
                        MessageAck ack,
                        MessageReference node)
                 throws IOException
Specified by:
acknowledge in interface Destination
Throws:
IOException

addSubscription

public void addSubscription(ConnectionContext context,
                            Subscription sub)
                     throws Exception
Specified by:
addSubscription in interface Destination
Throws:
Exception

browse

public Message[] browse()
Specified by:
browse in interface Destination

dispose

public void dispose(ConnectionContext context)
             throws IOException
Specified by:
dispose in interface Destination
Throws:
IOException

gc

public void gc()
Specified by:
gc in interface Destination

getActiveMQDestination

public ActiveMQDestination getActiveMQDestination()
Specified by:
getActiveMQDestination in interface Destination

getDeadLetterStrategy

public DeadLetterStrategy getDeadLetterStrategy()
Specified by:
getDeadLetterStrategy in interface Destination

getDestinationStatistics

public DestinationStatistics getDestinationStatistics()
Specified by:
getDestinationStatistics in interface Destination

getName

public String getName()
Specified by:
getName in interface Destination

getMemoryUsage

public MemoryUsage getMemoryUsage()
Specified by:
getMemoryUsage in interface Destination

removeSubscription

public void removeSubscription(ConnectionContext context,
                               Subscription sub,
                               long lastDeliveredSequenceId)
                        throws Exception
Specified by:
removeSubscription in interface Destination
Throws:
Exception

send

public void send(ProducerBrokerExchange context,
                 Message messageSend)
          throws Exception
Specified by:
send in interface Destination
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

getConsumers

public List<Subscription> getConsumers()
Specified by:
getConsumers in interface Destination

send

protected void send(ProducerBrokerExchange context,
                    Message message,
                    ActiveMQDestination destination)
             throws Exception
Sends a message to the given destination which may be a wildcard

Parameters:
context - broker context
message - message to send
destination - possibly wildcard destination to send the message to
Throws:
Exception - on error

getMessageStore

public MessageStore getMessageStore()
Specified by:
getMessageStore in interface Destination

isProducerFlowControl

public boolean isProducerFlowControl()
Specified by:
isProducerFlowControl in interface Destination

setProducerFlowControl

public void setProducerFlowControl(boolean value)
Specified by:
setProducerFlowControl in interface Destination

addProducer

public void addProducer(ConnectionContext context,
                        ProducerInfo info)
                 throws Exception
Specified by:
addProducer in interface Destination
Throws:
Exception

removeProducer

public void removeProducer(ConnectionContext context,
                           ProducerInfo info)
                    throws Exception
Specified by:
removeProducer in interface Destination
Throws:
Exception

getMaxAuditDepth

public int getMaxAuditDepth()
Specified by:
getMaxAuditDepth in interface Destination

getMaxProducersToAudit

public int getMaxProducersToAudit()
Specified by:
getMaxProducersToAudit in interface Destination

isEnableAudit

public boolean isEnableAudit()
Specified by:
isEnableAudit in interface Destination

setEnableAudit

public void setEnableAudit(boolean enableAudit)
Specified by:
setEnableAudit in interface Destination

setMaxAuditDepth

public void setMaxAuditDepth(int maxAuditDepth)
Specified by:
setMaxAuditDepth in interface Destination

setMaxProducersToAudit

public void setMaxProducersToAudit(int maxProducersToAudit)
Specified by:
setMaxProducersToAudit in interface Destination

isActive

public boolean isActive()
Specified by:
isActive in interface Destination

getMaxPageSize

public int getMaxPageSize()
Specified by:
getMaxPageSize in interface Destination

setMaxPageSize

public void setMaxPageSize(int maxPageSize)
Specified by:
setMaxPageSize in interface Destination

isUseCache

public boolean isUseCache()
Specified by:
isUseCache in interface Destination

setUseCache

public void setUseCache(boolean useCache)
Specified by:
setUseCache in interface Destination

getMinimumMessageSize

public int getMinimumMessageSize()
Specified by:
getMinimumMessageSize in interface Destination

setMinimumMessageSize

public void setMinimumMessageSize(int minimumMessageSize)
Specified by:
setMinimumMessageSize in interface Destination

wakeup

public void wakeup()
Description copied from interface: Destination
optionally called by a Subscriber - to inform the Destination its ready for more messages

Specified by:
wakeup in interface Destination

isLazyDispatch

public boolean isLazyDispatch()
Specified by:
isLazyDispatch in interface Destination
Returns:
true if lazyDispatch is enabled

setLazyDispatch

public void setLazyDispatch(boolean value)
Description copied from interface: Destination
set the lazy dispatch - default is false

Specified by:
setLazyDispatch in interface Destination

messageExpired

public void messageExpired(ConnectionContext context,
                           PrefetchSubscription prefetchSubscription,
                           MessageReference node)

iterate

public boolean iterate()
Specified by:
iterate in interface Task

fastProducer

public void fastProducer(ConnectionContext context,
                         ProducerInfo producerInfo)
Description copied from interface: Destination
Called to notify a producer is too fast

Specified by:
fastProducer in interface Destination

isFull

public void isFull(ConnectionContext context,
                   Usage usage)
Description copied from interface: Destination
Called when a Usage reaches a limit

Specified by:
isFull in interface Destination

messageConsumed

public void messageConsumed(ConnectionContext context,
                            MessageReference messageReference)
Description copied from interface: Destination
called when message is consumed

Specified by:
messageConsumed in interface Destination

messageDelivered

public void messageDelivered(ConnectionContext context,
                             MessageReference messageReference)
Description copied from interface: Destination
Called when message is delivered to the broker

Specified by:
messageDelivered in interface Destination

messageDiscarded

public void messageDiscarded(ConnectionContext context,
                             MessageReference messageReference)
Description copied from interface: Destination
Called when a message is discarded - e.g. running low on memory This will happen only if the policy is enabled - e.g. non durable topics

Specified by:
messageDiscarded in interface Destination

slowConsumer

public void slowConsumer(ConnectionContext context,
                         Subscription subs)
Description copied from interface: Destination
Called when there is a slow consumer

Specified by:
slowConsumer in interface Destination

messageExpired

public void messageExpired(ConnectionContext context,
                           Subscription subs,
                           MessageReference node)
Description copied from interface: Destination
Inform the Destination a message has expired

Specified by:
messageExpired in interface Destination

getMaxBrowsePageSize

public int getMaxBrowsePageSize()
Specified by:
getMaxBrowsePageSize in interface Destination

setMaxBrowsePageSize

public void setMaxBrowsePageSize(int maxPageSize)
Specified by:
setMaxBrowsePageSize in interface Destination

processDispatchNotification

public void processDispatchNotification(MessageDispatchNotification messageDispatchNotification)
                                 throws Exception
Description copied from interface: Destination
called on Queues in slave mode to allow dispatch to follow subscription choice of master

Specified by:
processDispatchNotification in interface Destination
Throws:
Exception


Copyright © 2009. All Rights Reserved.