Package io.servicetalk.transport.api
Class DelegatingConnectionAcceptor
java.lang.Object
io.servicetalk.transport.api.DelegatingConnectionAcceptor
- All Implemented Interfaces:
AsyncCloseable
,ConnectionAcceptor
An implementation of
ConnectionAcceptor
that delegates all methods to another ConnectionAcceptor
.-
Field Summary
Fields inherited from interface io.servicetalk.transport.api.ConnectionAcceptor
ACCEPT_ALL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept
(ConnectionContext context) Evaluate the passedConnectionContext
to accept or reject.Used to close/shutdown a resource.Used to close/shutdown a resource, similar toAsyncCloseable.closeAsync()
, but attempts to cleanup state before abruptly closing.protected final ConnectionAcceptor
delegate()
TheConnectionAcceptor
to which all calls are delegated to.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.servicetalk.transport.api.ConnectionAcceptor
append
-
Constructor Details
-
DelegatingConnectionAcceptor
New instance.- Parameters:
delegate
-ConnectionAcceptor
to delegate all calls to.
-
-
Method Details
-
accept
Description copied from interface:ConnectionAcceptor
Evaluate the passedConnectionContext
to accept or reject. If the returnedCompletable
terminates successfully then the passedConnectionContext
will be accepted, otherwise rejected.- Specified by:
accept
in interfaceConnectionAcceptor
- Parameters:
context
- theConnectionContext
to evaluate.- Returns:
Completable
, which when terminated successfully, the passedConnectionContext
is accepted, otherwise rejected.
-
closeAsync
Description copied from interface:AsyncCloseable
Used to close/shutdown a resource.- Specified by:
closeAsync
in interfaceAsyncCloseable
- Specified by:
closeAsync
in interfaceConnectionAcceptor
- Returns:
- A
Completable
that is notified once the close is complete.
-
closeAsyncGracefully
Description copied from interface:AsyncCloseable
Used to close/shutdown a resource, similar toAsyncCloseable.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 toAsyncCloseable.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()
.- Specified by:
closeAsyncGracefully
in interfaceAsyncCloseable
- Returns:
- A
Completable
that is notified once the close is complete.
-
delegate
TheConnectionAcceptor
to which all calls are delegated to.- Returns:
ConnectionAcceptor
to which all calls are delegated.
-