public interface Closable
Modifier and Type | Interface and Description |
---|---|
static interface |
Closable.CloseAutomaton
The
Closable.CloseAutomaton interface defines those methods related to the
closing of connection(s) life-cycle. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component's connection(s).
|
default void |
closeIn(int aCloseInMillis)
Tries to close the component's connection(s) after the given time in
milliseconds.
|
default void |
closeQuietly()
Tries to close the component's connection(s).
|
void close() throws CloseException
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).CloseException
- in case closing or pre-closing (flushing) fails.default void closeQuietly()
close()
method with an
according exception.
The default implementation tries to invoke a "flush()" in case the
implementing instance implements the Flushable
interface
before invoking close()
. Additionally the default implementation
tries IoRetryCount.NORM
number of times to invoke
close()
till a timeout of IoTimeout.NORM
is reached. In
any case this method will return quietly without throwing any exception.default void closeIn(int aCloseInMillis)
HiddenException
. Use (if implemented)
ClosedAccessor.isClosed()
to finally determine whether the close
operation succeeded.aCloseInMillis
- The time in milliseconds to pass till
close()
is called.Copyright © 2016. All rights reserved.