|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface marking this object as being "disposable". Disposing an object should immediately dispose all system resources, disconnect all navigable links (data relationships), null all external references, and render this object unusable (accessors throw IllegalStateException and/or NullPointerException). Disposal may be neccessary, such as when system resources need to be freed immediately rather than waiting for finalization, or it may be a convenience, such as a delegator eliminating its delegate node in a navigable data structure.
Disposal should chain to the super class (like finalize()). Calling dispose() may call dispose() recursively or mutually on disposable dependencies, such as the parent or children in a containment pattern. Such situations generally require detection and blocking of disposal cycles (see AbstractDisposable).
Depending on the nature of the disposal this object's Object.finalize() method may need to call dispose(). Note, however, that finalize() can seriously impact garbage collection performance, and its use should be carefully considered.
Method Summary | |
void |
dispose()
Disposes this object and its dependencies, making this object inactive and unusable. |
boolean |
isDisposed()
Returns whether or not this object has been disposed (dispose() has been previously called). |
Method Detail |
public void dispose()
public boolean isDisposed()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |