org.apache.qpid.server.virtualhost.plugins
Class ConfiguredQueueBindingListener

java.lang.Object
  extended by org.apache.qpid.server.virtualhost.plugins.ConfiguredQueueBindingListener
All Implemented Interfaces:
Exchange.BindingListener

public class ConfiguredQueueBindingListener
extends Object
implements Exchange.BindingListener

This is a listener that caches queues that are configured for slow consumer disconnection. There should be one listener per virtual host, which can be added to all exchanges on that host. TODO In future, it will be possible to configure the policy at runtime, so only the queue itself is cached, and the configuration looked up by the housekeeping thread. This means that there may be occasions where the copy of the cache contents retrieved by the thread does not contain queues that are configured, or that configured queues are not present.

See Also:
Exchange.BindingListener

Constructor Summary
ConfiguredQueueBindingListener(String vhostName)
           
 
Method Summary
 void bindingAdded(Exchange exchange, Binding binding)
           
 void bindingRemoved(Exchange exchange, Binding binding)
           
 Set<AMQQueue> getQueueCache()
          Lookup and return the cache of configured AMQQueues.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfiguredQueueBindingListener

public ConfiguredQueueBindingListener(String vhostName)
Method Detail

bindingAdded

public void bindingAdded(Exchange exchange,
                         Binding binding)
Specified by:
bindingAdded in interface Exchange.BindingListener
See Also:
Exchange.BindingListener.bindingAdded(Exchange, Binding)

bindingRemoved

public void bindingRemoved(Exchange exchange,
                           Binding binding)
Specified by:
bindingRemoved in interface Exchange.BindingListener
See Also:
Exchange.BindingListener.bindingRemoved(Exchange, Binding)

getQueueCache

public Set<AMQQueue> getQueueCache()
Lookup and return the cache of configured AMQQueues. Note that when accessing the cached queues, the Iterator is not thread safe (see the Collections.synchronizedSet(Set) documentation) so a copy of the cache is returned.

Returns:
a copy of the cached Set of queues


Licensed to the Apache Software Foundation