H
- The type of the handle.public interface ClosableHandle<H>
ClosableHandle
interface defines those methods related to the
handle based close life-cycle.
The handle reference requires the Closable
interface to be
implemented.
Modifier and Type | Interface and Description |
---|---|
static interface |
ClosableHandle.CloseAutomatonHandle<H>
The
ClosableHandle.CloseAutomatonHandle interface defines those methods related
to the handle based close life-cycle. |
Modifier and Type | Method and Description |
---|---|
void |
close(H aHandle)
Closes or pre-closes (flush) the component identified by the given
handle.
|
default void |
closeUnchecked(H aHandle)
Closes the component by calling
close(Object) without you to
require catching an CloseException . |
boolean |
hasClosable(H aHandle)
Determines whether the handle reference is closable by implementing the
Closable interface. |
boolean hasClosable(H aHandle) throws UnknownHandleRuntimeException
Closable
interface.aHandle
- The handle to test whether the reference provides the
according functionality.UnknownHandleRuntimeException
- in case the handle is unknown.void close(H aHandle) throws CloseException, UnknownHandleRuntimeException, UnsupportedHandleOperationRuntimeException, IllegaleHandleStateChangeRuntimeException
CloseException
as upon close we may have to do
things like flushing buffers which can fail (and would otherwise fail
unhandled or even worse unnoticed).aHandle
- The handle identifying the component.CloseException
- Thrown in case closing or pre-closing (flushing)
fails.UnknownHandleRuntimeException
- in case the given handle is
unknown.UnsupportedHandleOperationRuntimeException
- in case the reference
of the handle does not support the requested operation.IllegaleHandleStateChangeRuntimeException
- Thrown in case a state
change is not possible due to the current state the referenced
component is in.default void closeUnchecked(H aHandle)
close(Object)
without you to
require catching an CloseException
.aHandle
- The handle identifying the component.org.refcodes.exception.HiddenException
- encapsulates the cause and is thrown upon
encountering a CloseException
exceptionCopyright © 2018. All rights reserved.