Captures the 'closed' state of an object, that is initially open, can be tested to see if it is closed, and provides a 'close' method to close it.
CRC Card Responsibilities | Collaborations |
---|
Mark an object as closed. |
Check if an object is closed. |
Raise a JMS exception if an object is closed. |
@todo Might be better to make this an interface. This whole class doesn't really encapsulate a terribly neatpiece of re-usable functionality. A simple interface defining a close method would suffice.
@todo The convenience method {@link #checkNotClosed} is not that helpfull, what if the caller wants to do somethingother than throw an exception? It doesn't really represent a very usefull re-usable piece of code. Consider inlining it and dropping the method.