public abstract class Closeable extends Object
TODO Might be better to make this an interface. This whole class doesn't really encapsulate a terribly neat piece of re-usable functionality. A simple interface defining a close method would suffice.
TODO The convenience method checkNotClosed()
is not that helpfull, what if the caller wants to do something
other than throw an exception? It doesn't really represent a very usefull re-usable piece of code. Consider
inlining it and dropping the method.
Constructor and Description |
---|
Closeable() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed()
Checks if this is closed, and raises a JMSException if it is.
|
abstract void |
close()
Closes this object.
|
boolean |
isClosed()
Checks if this is closed.
|
boolean |
isClosing()
Checks if this is closing.
|
protected boolean |
setClosed() |
protected void |
setClosing(boolean closing) |
protected void checkNotClosed() throws javax.jms.JMSException
javax.jms.JMSException
- If this is closed.public boolean isClosed()
public boolean isClosing()
protected boolean setClosed()
protected void setClosing(boolean closing)
public abstract void close() throws javax.jms.JMSException
javax.jms.JMSException
- If this cannot be closed for any reason.Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.