org.apache.qpid.client
Class Closeable

java.lang.Object
  extended by org.apache.qpid.client.Closeable
Direct Known Subclasses:
AMQConnection, AMQSession, BasicMessageConsumer, BasicMessageProducer

public abstract class Closeable
extends java.lang.Object

Provides support for orderly shutdown of an object.


Field Summary
protected  java.util.concurrent.atomic.AtomicBoolean _closed
          We use an atomic boolean so that we do not have to synchronized access to this flag.
 
Constructor Summary
Closeable()
           
 
Method Summary
protected  void checkNotClosed()
           
abstract  void close()
           
 boolean isClosed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_closed

protected final java.util.concurrent.atomic.AtomicBoolean _closed
We use an atomic boolean so that we do not have to synchronized access to this flag. Synchronizing access to this flag would mean have a synchronized block in every method.

Constructor Detail

Closeable

public Closeable()
Method Detail

checkNotClosed

protected void checkNotClosed()
                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

isClosed

public boolean isClosed()

close

public abstract void close()
                    throws javax.jms.JMSException
Throws:
javax.jms.JMSException