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, 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  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()
           
 java.lang.String getName()
           
 int getTicket()
           
 void initialise(java.lang.String 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, registerQueue, route
 

Field Detail

_durable

protected boolean _durable

_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 java.lang.String getName()
Specified by:
getName in interface Exchange

createMBean

protected abstract AbstractExchange.ExchangeMBean createMBean()
                                                       throws org.apache.qpid.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:
org.apache.qpid.AMQException

initialise

public void initialise(java.lang.String name,
                       boolean durable,
                       int ticket,
                       boolean autoDelete)
                throws org.apache.qpid.AMQException
Specified by:
initialise in interface Exchange
Throws:
org.apache.qpid.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 org.apache.qpid.AMQException
Specified by:
close in interface Exchange
Throws:
org.apache.qpid.AMQException

toString

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

getManagedObject

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