public abstract class NonWrappingRequestContext extends AbstractRequestContext
RequestContext
implementation.Modifier | Constructor and Description |
---|---|
protected |
NonWrappingRequestContext(SessionProtocol sessionProtocol,
java.lang.String method,
java.lang.String path,
java.lang.Object request)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
<T> io.netty.util.Attribute<T> |
attr(io.netty.util.AttributeKey<T> key) |
java.util.Iterator<io.netty.util.Attribute<?>> |
attrs()
Returns all
Attribute s set in this context. |
protected abstract io.netty.channel.Channel |
channel()
Returns the
Channel that is handling this request, or null if the connection is not
established yet. |
<T> boolean |
hasAttr(io.netty.util.AttributeKey<T> key) |
void |
invokeOnEnterCallbacks()
Invokes all
RequestContext.onEnter(Runnable) callbacks. |
void |
invokeOnExitCallbacks()
Invokes all
RequestContext.onExit(Runnable) callbacks. |
<A extends java.net.SocketAddress> |
localAddress()
Returns the local address of this request, or
null if the connection is not established yet. |
java.lang.String |
method()
Returns the session-layer method name of the current
Request . |
void |
onEnter(java.lang.Runnable callback)
Registers
callback to be run when re-entering this RequestContext , usually when using
the RequestContext.makeContextAware(java.util.concurrent.Executor) family of methods. |
void |
onExit(java.lang.Runnable callback)
Registers
callback to be run when re-exiting this RequestContext , usually when using
the RequestContext.makeContextAware(java.util.concurrent.Executor) family of methods. |
java.lang.String |
path()
Returns the absolute path part of the current
Request , as defined in
the
section 5.1.2 of RFC2616. |
<A extends java.net.SocketAddress> |
remoteAddress()
Returns the remote address of this request, or
null if the connection is not established yet. |
<T> T |
request()
Returns the
Request associated with this context. |
SessionProtocol |
sessionProtocol()
Returns the
SessionProtocol of the current Request . |
javax.net.ssl.SSLSession |
sslSession()
The
SSLSession for this request if the connection is made over TLS, or null if
the connection is not established yet or the connection is not a TLS connection. |
contextAwareEventLoop, equals, hashCode, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, makeContextAware, rejectPromise, resolvePromise
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
current, eventLoop, log, logBuilder, makeContextAware, mapCurrent, push, push
protected NonWrappingRequestContext(SessionProtocol sessionProtocol, java.lang.String method, java.lang.String path, java.lang.Object request)
sessionProtocol
- the SessionProtocol
of the invocationrequest
- the request associated with this contextpublic final SessionProtocol sessionProtocol()
RequestContext
SessionProtocol
of the current Request
.@Nullable protected abstract io.netty.channel.Channel channel()
Channel
that is handling this request, or null
if the connection is not
established yet.@Nullable public <A extends java.net.SocketAddress> A remoteAddress()
RequestContext
null
if the connection is not established yet.@Nullable public <A extends java.net.SocketAddress> A localAddress()
RequestContext
null
if the connection is not established yet.@Nullable public javax.net.ssl.SSLSession sslSession()
RequestContext
SSLSession
for this request if the connection is made over TLS, or null
if
the connection is not established yet or the connection is not a TLS connection.public final java.lang.String method()
RequestContext
Request
. e.g. "GET" or "POST" for HTTPpublic final java.lang.String path()
RequestContext
Request
, as defined in
the
section 5.1.2 of RFC2616.public final <T> T request()
RequestContext
Request
associated with this context.public <T> io.netty.util.Attribute<T> attr(io.netty.util.AttributeKey<T> key)
public <T> boolean hasAttr(io.netty.util.AttributeKey<T> key)
public java.util.Iterator<io.netty.util.Attribute<?>> attrs()
RequestContext
Attribute
s set in this context.public final void onEnter(java.lang.Runnable callback)
RequestContext
callback
to be run when re-entering this RequestContext
, usually when using
the RequestContext.makeContextAware(java.util.concurrent.Executor)
family of methods. Any thread-local state associated with this context
should be restored by this callback.public final void onExit(java.lang.Runnable callback)
RequestContext
callback
to be run when re-exiting this RequestContext
, usually when using
the RequestContext.makeContextAware(java.util.concurrent.Executor)
family of methods. Any thread-local state associated with this context
should be reset by this callback.public void invokeOnEnterCallbacks()
RequestContext
RequestContext.onEnter(Runnable)
callbacks. It is discouraged to use this method directly.
Use RequestContext.makeContextAware(Runnable)
or RequestContext.push(RequestContext, boolean)
instead so that
the callbacks are invoked automatically.public void invokeOnExitCallbacks()
RequestContext
RequestContext.onExit(Runnable)
callbacks. It is discouraged to use this method directly.
Use RequestContext.makeContextAware(Runnable)
or RequestContext.push(RequestContext, boolean)
instead so that
the callbacks are invoked automatically.