public class DelegatingHttpServiceContext extends HttpServiceContext
HttpServiceContext
that delegates all calls to a provided HttpServiceContext
.
Any method can be overridden to change this default behavior.HttpConnectionContext.HttpProtocol
ConnectionContext.Protocol
Constructor and Description |
---|
DelegatingHttpServiceContext(HttpServiceContext other)
New instance.
|
Modifier and Type | Method and Description |
---|---|
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. |
HttpExecutionContext |
executionContext()
Get the
ExecutionContext for this ConnectionContext . |
java.net.SocketAddress |
localAddress()
The
SocketAddress to which the associated connection is bound. |
Completable |
onClose()
Returns a
Completable that is notified once the ListenableAsyncCloseable was closed. |
HttpConnectionContext.HttpProtocol |
protocol()
Get the
ConnectionContext.Protocol for this ConnectionContext . |
java.net.SocketAddress |
remoteAddress()
The
SocketAddress to which the associated connection is connected. |
<T> T |
socketOption(java.net.SocketOption<T> option)
|
javax.net.ssl.SSLSession |
sslSession()
Get the
SSLSession for this connection. |
blockingStreamingResponseFactory, headersFactory, responseFactory, streamingResponseFactory
public DelegatingHttpServiceContext(HttpServiceContext other)
other
- HttpServiceContext
to delegate all calls.public java.net.SocketAddress localAddress()
ConnectionContext
SocketAddress
to which the associated connection is bound.SocketAddress
to which the associated connection is bound.public java.net.SocketAddress remoteAddress()
ConnectionContext
SocketAddress
to which the associated connection is connected.SocketAddress
to which the associated connection is connected.@Nullable public javax.net.ssl.SSLSession sslSession()
ConnectionContext
SSLSession
for this connection.SSLSession
if SSL/TLS is enabled, or null
otherwise.public HttpExecutionContext executionContext()
ConnectionContext
ExecutionContext
for this ConnectionContext
.
The ExecutionContext.ioExecutor()
will represent the thread responsible for IO for this
ConnectionContext
. Note that this maybe different that what was used to create this object because
at this time a specific IoExecutor
has been selected.
ExecutionContext
for this ConnectionContext
.@Nullable public <T> T socketOption(java.net.SocketOption<T> option)
ConnectionContext
T
- the type of the SocketOption
value.option
- SocketOption
to get.SocketOption
value of type T
for this ConnectionContext
or null
if
this SocketOption
is not supported by this ConnectionContext
.StandardSocketOptions
,
ServiceTalkSocketOptions
public HttpConnectionContext.HttpProtocol protocol()
ConnectionContext
ConnectionContext.Protocol
for this ConnectionContext
.ConnectionContext.Protocol
for this ConnectionContext
.public Completable onClose()
ListenableAsyncCloseable
Completable
that is notified once the ListenableAsyncCloseable
was closed.Completable
that is notified on close.public Completable closeAsync()
AsyncCloseable
CompletableSource
that is notified once the close is complete.public Completable closeAsyncGracefully()
AsyncCloseable
AsyncCloseable.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()
.
Completable
that is notified once the close is complete.