Package io.servicetalk.transport.api
Class DelegatingConnectionContext
java.lang.Object
io.servicetalk.concurrent.api.DelegatingAsyncCloseable<T>
io.servicetalk.concurrent.api.DelegatingListenableAsyncCloseable<ConnectionContext>
io.servicetalk.transport.api.DelegatingConnectionContext
- All Implemented Interfaces:
AsyncCloseable
,ListenableAsyncCloseable
,ConnectionContext
,ConnectionInfo
- Direct Known Subclasses:
DelegatingHttpConnectionContext
public class DelegatingConnectionContext
extends DelegatingListenableAsyncCloseable<ConnectionContext>
implements ConnectionContext
A
ConnectionContext
implementation that delegates all calls to a provided ConnectionContext
. Any of
the methods can be overridden by implementations to change the behavior.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.transport.api.ConnectionInfo
ConnectionInfo.Protocol
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConnectionContext
delegate()
Get theConnectionContext
that this class delegates to.Get theExecutionContext
for thisConnectionInfo
.TheSocketAddress
to which the associated connection is bound.parent()
Returns a reference to a parentConnectionContext
if any.protocol()
Get theConnectionInfo.Protocol
for thisConnectionInfo
.TheSocketAddress
to which the associated connection is connected.<T> T
socketOption
(SocketOption<T> option) Get theSslConfig
for this connection.Get theSSLSession
for this connection.toString()
Methods inherited from class io.servicetalk.concurrent.api.DelegatingListenableAsyncCloseable
onClose, onClosing
Methods inherited from class io.servicetalk.concurrent.api.DelegatingAsyncCloseable
closeAsync, closeAsyncGracefully
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Constructor Details
-
DelegatingConnectionContext
New instance.- Parameters:
delegate
-ConnectionContext
to delegate all calls.
-
-
Method Details
-
delegate
Get theConnectionContext
that this class delegates to.- Overrides:
delegate
in classDelegatingListenableAsyncCloseable<ConnectionContext>
- Returns:
- the
ConnectionContext
that this class delegates to.
-
localAddress
Description copied from interface:ConnectionInfo
TheSocketAddress
to which the associated connection is bound.- Specified by:
localAddress
in interfaceConnectionInfo
- Returns:
- The
SocketAddress
to which the associated connection is bound.
-
remoteAddress
Description copied from interface:ConnectionInfo
TheSocketAddress
to which the associated connection is connected.- Specified by:
remoteAddress
in interfaceConnectionInfo
- Returns:
- The
SocketAddress
to which the associated connection is connected.
-
sslConfig
Description copied from interface:ConnectionInfo
Get theSslConfig
for this connection.- Specified by:
sslConfig
in interfaceConnectionInfo
- Returns:
- The
SslConfig
if SSL/TLS is configured, ornull
otherwise.
-
sslSession
Description copied from interface:ConnectionInfo
Get theSSLSession
for this connection.- Specified by:
sslSession
in interfaceConnectionInfo
- Returns:
- The
SSLSession
if SSL/TLS is enabled, ornull
otherwise.
-
executionContext
Description copied from interface:ConnectionInfo
Get theExecutionContext
for thisConnectionInfo
.The
ExecutionContext.ioExecutor()
will represent the thread responsible for IO for thisConnectionInfo
. Note that this maybe different that what was used to create this object because at this time a specificIoExecutor
has been selected.- Specified by:
executionContext
in interfaceConnectionInfo
- Returns:
- the
ExecutionContext
for thisConnectionInfo
.
-
socketOption
Description copied from interface:ConnectionInfo
- Specified by:
socketOption
in interfaceConnectionInfo
- Type Parameters:
T
- the type of theSocketOption
value.- Parameters:
option
-SocketOption
to get.- Returns:
- the
SocketOption
value of typeT
for thisConnectionInfo
ornull
if thisSocketOption
is not supported by thisConnectionInfo
. - See Also:
-
protocol
Description copied from interface:ConnectionInfo
Get theConnectionInfo.Protocol
for thisConnectionInfo
.- Specified by:
protocol
in interfaceConnectionInfo
- Returns:
- the
ConnectionInfo.Protocol
for thisConnectionInfo
.
-
parent
Description copied from interface:ConnectionContext
Returns a reference to a parentConnectionContext
if any.This method is useful when multiple virtual streams are multiplexed over a single connection to get access to the actual
ConnectionContext
that represents network.- Specified by:
parent
in interfaceConnectionContext
- Returns:
- a reference to a parent
ConnectionContext
if any. Otherwise, returnsnull
.
-
toString
- Overrides:
toString
in classDelegatingAsyncCloseable<ConnectionContext>
-