X
- The exception type which may get thrown by close()
.
If this is an IOException
, then the subclass can implement
the Closeable
interface, too.@CleanupObligation public abstract class Resource<X extends Exception> extends Object
Constructor and Description |
---|
Resource() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this resource.
|
protected abstract void |
onClose() |
@DischargesObligation public final void close() throws X extends Exception
onClose()
gets
called.
Otherwhise the call gets ignored.
Upon successful return from onClose()
, this resource gets marked
as closed, so a subsequent call to this method will do nothing.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.