org.apache.qpid.server.exchange
Class AbstractExchange

java.lang.Object
  extended by org.apache.qpid.server.exchange.AbstractExchange
All Implemented Interfaces:
Exchange, Managable
Direct Known Subclasses:
DestNameExchange, DestWildExchange, FanoutExchange, HeadersExchange

public abstract class AbstractExchange
extends java.lang.Object
implements Exchange, Managable


Nested Class Summary
protected  class AbstractExchange.ExchangeMBean
          Abstract MBean class.
 
Field Summary
protected  boolean _autoDelete
          Whether the exchange is automatically deleted once all queues have detached from it
protected  boolean _durable
           
protected  AbstractExchange.ExchangeMBean _exchangeMbean
           
protected  java.lang.String _exchangeType
           
protected  int _ticket
           
 
Constructor Summary
AbstractExchange()
           
 
Method Summary
 void close()
           
protected abstract  AbstractExchange.ExchangeMBean createMBean()
          Concrete exchanges must implement this method in order to create the managed representation.
 ManagedObject getManagedObject()
           
 AMQShortString getName()
           
 QueueRegistry getQueueRegistry()
           
 int getTicket()
           
 VirtualHost getVirtualHost()
           
 void initialise(VirtualHost host, AMQShortString name, boolean durable, int ticket, boolean autoDelete)
           
 boolean isAutoDelete()
           
 boolean isDurable()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.server.exchange.Exchange
deregisterQueue, getType, hasBindings, isBound, isBound, isBound, registerQueue, route
 

Field Detail

_durable

protected boolean _durable

_exchangeType

protected java.lang.String _exchangeType

_ticket

protected int _ticket

_exchangeMbean

protected AbstractExchange.ExchangeMBean _exchangeMbean

_autoDelete

protected boolean _autoDelete
Whether the exchange is automatically deleted once all queues have detached from it

Constructor Detail

AbstractExchange

public AbstractExchange()
Method Detail

getName

public AMQShortString getName()
Specified by:
getName in interface Exchange

createMBean

protected abstract AbstractExchange.ExchangeMBean createMBean()
                                                       throws AMQException
Concrete exchanges must implement this method in order to create the managed representation. This is called during initialisation (template method pattern).

Returns:
the MBean
Throws:
AMQException

initialise

public void initialise(VirtualHost host,
                       AMQShortString name,
                       boolean durable,
                       int ticket,
                       boolean autoDelete)
                throws AMQException
Specified by:
initialise in interface Exchange
Throws:
AMQException

isDurable

public boolean isDurable()
Specified by:
isDurable in interface Exchange

isAutoDelete

public boolean isAutoDelete()
Specified by:
isAutoDelete in interface Exchange
Returns:
true if the exchange will be deleted after all queues have been detached

getTicket

public int getTicket()
Specified by:
getTicket in interface Exchange

close

public void close()
           throws AMQException
Specified by:
close in interface Exchange
Throws:
AMQException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getManagedObject

public ManagedObject getManagedObject()
Specified by:
getManagedObject in interface Managable

getVirtualHost

public VirtualHost getVirtualHost()

getQueueRegistry

public QueueRegistry getQueueRegistry()


Copyright © 2007. All Rights Reserved.