public class DelegatingConnectionAcceptor extends java.lang.Object implements ConnectionAcceptor
ConnectionAcceptor that delegates all methods to another ConnectionAcceptor.ACCEPT_ALL| Constructor and Description |
|---|
DelegatingConnectionAcceptor(ConnectionAcceptor delegate)
New instance.
|
| Modifier and Type | Method and Description |
|---|---|
Completable |
accept(ConnectionContext context)
Evaluate the passed
ConnectionContext to accept or reject. |
Completable |
closeAsync()
Used to close/shutdown a resource.
|
Completable |
closeAsyncGracefully()
Used to close/shutdown a resource, similar to
AsyncCloseable.closeAsync(), but attempts to cleanup state before
abruptly closing. |
protected ConnectionAcceptor |
delegate()
The
ConnectionAcceptor to which all calls are delegated to. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendpublic DelegatingConnectionAcceptor(ConnectionAcceptor delegate)
delegate - ConnectionAcceptor to delegate all calls to.public Completable accept(ConnectionContext context)
ConnectionAcceptorConnectionContext to accept or reject. If the returned Completable terminates
successfully then the passed ConnectionContext will be accepted, otherwise rejected.accept in interface ConnectionAcceptorcontext - the ConnectionContext to evaluate.Completable, which when terminated successfully, the passed ConnectionContext
is accepted, otherwise rejected.public Completable closeAsync()
AsyncCloseablecloseAsync in interface AsyncCloseablecloseAsync in interface ConnectionAcceptorCompletableSource that is notified once the close is complete.public Completable closeAsyncGracefully()
AsyncCloseableAsyncCloseable.closeAsync(), but attempts to cleanup state before
abruptly closing. This provides a hint that implementations can use to stop accepting new work and finish in
flight work. This method is implemented on a "best effort" basis and may be equivalent to AsyncCloseable.closeAsync().
Note: Implementations may or may not apply a timeout for this operation to complete, if a caller does not
want to wait indefinitely, and are unsure if the implementation applies a timeout, it is advisable to apply a
timeout and force a call to AsyncCloseable.closeAsync().
closeAsyncGracefully in interface AsyncCloseableCompletable that is notified once the close is complete.protected final ConnectionAcceptor delegate()
ConnectionAcceptor to which all calls are delegated to.ConnectionAcceptor to which all calls are delegated.