| Modifier and Type | Class and Description |
|---|---|
| public static enum |
| Modifier and Type | Field and Description |
|---|---|
| protected final CloseFuture | closeFuture
A future that will be set 'closed' when the object is actually closed |
| protected final Object | futureLock
Lock object for |
| protected final AtomicReference | state
State of this object |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addCloseFutureListener(SshFutureListener<CloseFuture>
The notification listener)SshFutureListener - never nullImplements org. Pre-register a listener to be informed when resource is closed. |
| protected Builder | |
| public final CloseFuture | close(boolean
true if the resource should be shut down abruptly, false for a
graceful closeImplements org. Close this resource asynchronously and return a future. |
| protected CloseFuture | |
| protected void | doCloseImmediately()
doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. |
| public Object | |
| public final boolean | isClosed()
Implements org. Returns |
| public final boolean | isClosing()
Implements org. Returns |
| protected void | |
| public void | removeCloseFutureListener(SshFutureListener<CloseFuture>
The register listener)SshFutureListener - never null. Ignored if not registered or
resource already closedImplements org. Remove a pre-registered close event listener |
| closeFuture | back to summary |
|---|---|
| protected final CloseFuture closeFuture A future that will be set 'closed' when the object is actually closed | |
| futureLock | back to summary |
|---|---|
| protected final Object futureLock Lock object for | |
| state | back to summary |
|---|---|
| protected final AtomicReference<AbstractCloseable. State of this object | |
| AbstractCloseable | back to summary |
|---|---|
| protected AbstractCloseable() | |
| AbstractCloseable | back to summary |
|---|---|
| protected AbstractCloseable(String discriminator) | |
| addCloseFutureListener | back to summary |
|---|---|
| public void addCloseFutureListener(SshFutureListener<CloseFuture> listener) Implements org. Doc from org. Pre-register a listener to be informed when resource is closed. If resource is already closed, the listener will be invoked immediately and not registered for future notification
| |
| builder | back to summary |
|---|---|
| protected Builder builder() | |
| close | back to summary |
|---|---|
| public final CloseFuture close(boolean immediately) Implements org. Doc from org. Close this resource asynchronously and return a future. Resources support two closing modes: a graceful mode which will cleanly close the resource and an immediate mode which will close the resources abruptly.
| |
| doCloseGracefully | back to summary |
|---|---|
| protected CloseFuture doCloseGracefully() | |
| doCloseImmediately | back to summary |
|---|---|
| protected void doCloseImmediately() doCloseImmediately is called once and only once with state == Immediate Overriding methods should always call the base implementation. It may be called concurrently while preClose() or doCloseGracefully is executing | |
| getFutureLock | back to summary |
|---|---|
| public Object getFutureLock() | |
| isClosed | back to summary |
|---|---|
| public final boolean isClosed() Implements org. Doc from org. Returns
| |
| isClosing | back to summary |
|---|---|
| public final boolean isClosing() Implements org. Doc from org. Returns
| |
| preClose | back to summary |
|---|---|
| protected void preClose() preClose is guaranteed to be called before doCloseGracefully or doCloseImmediately. When preClose() is called, isClosing() == true | |
| removeCloseFutureListener | back to summary |
|---|---|
| public void removeCloseFutureListener(SshFutureListener<CloseFuture> listener) Implements org. Doc from org. Remove a pre-registered close event listener
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final AbstractCloseable. | Closed
Connection is closed |
| public static final AbstractCloseable. | Graceful
Connection is being closed gracefully |
| public static final AbstractCloseable. | Immediate
Connection is being terminated immediately |
| public static final AbstractCloseable. | Opened
Connection is open |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static AbstractCloseable. | |
| public static AbstractCloseable. |
| Closed | back to summary |
|---|---|
| public static final AbstractCloseable. Connection is closed | |
| Graceful | back to summary |
|---|---|
| public static final AbstractCloseable. Connection is being closed gracefully | |
| Immediate | back to summary |
|---|---|
| public static final AbstractCloseable. Connection is being terminated immediately | |
| Opened | back to summary |
|---|---|
| public static final AbstractCloseable. Connection is open | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static AbstractCloseable. | |
| values | back to summary |
|---|---|
| public static AbstractCloseable. | |