- All Implemented Interfaces:
org.eclipse.jetty.io.Content.Source,Request,org.eclipse.jetty.util.Attributes,org.eclipse.jetty.util.thread.Invocable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
org.eclipse.jetty.util.Attributes.Layer, org.eclipse.jetty.util.Attributes.Lazy, org.eclipse.jetty.util.Attributes.Mapped, org.eclipse.jetty.util.Attributes.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request
Request.AuthenticationState, Request.Handler, Request.ServeAs, Request.Wrapper -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.Attributes
NULLFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOPFields inherited from interface org.eclipse.jetty.server.Request
CACHE_ATTRIBUTE, COOKIE_ATTRIBUTE, DEFAULT_LOCALES -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContextRequest(ContextHandler.ScopedContext context, Request request) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFailureListener(Consumer<Throwable> onFailure) Adds a listener for asynchronous hard errors.voidaddIdleTimeoutListener(Predicate<TimeoutException> onIdleTimeout) Adds a listener for idle timeouts.voidGet theContextassociated with thisRequest.Methods inherited from class org.eclipse.jetty.server.Request.Wrapper
addHttpStreamWrapper, consumeAvailable, fail, getBeginNanoTime, getComponents, getConnectionMetaData, getHeaders, getHeadersNanoTime, getHttpURI, getId, getLength, getMethod, getSession, getTrailers, getTunnelSupport, getWrapped, isSecure, push, readMethods inherited from class org.eclipse.jetty.util.Attributes.Wrapper
clearAttributes, equals, getAttribute, getAttributeNameSet, hashCode, removeAttribute, setAttributeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Attributes
asAttributeMap, clearAttributes, getAttribute, getAttributeNameSet, removeAttribute, setAttributeMethods inherited from interface org.eclipse.jetty.io.Content.Source
fail, rewindMethods inherited from interface org.eclipse.jetty.util.thread.Invocable
getInvocationType
-
Constructor Details
-
ContextRequest
-
-
Method Details
-
demand
Description copied from interface:Request- Specified by:
demandin interfaceorg.eclipse.jetty.io.Content.Source- Specified by:
demandin interfaceRequest- Overrides:
demandin classRequest.Wrapper- Parameters:
demandCallback- the demand callback to invoke when there is a content chunk available. In addition to the invocation guarantees ofContent.Source.demand(Runnable), this implementation serializes the invocation of theRunnablewith invocations of anyResponse.write(boolean, ByteBuffer, Callback)Callbackinvocations.- See Also:
-
addIdleTimeoutListener
Description copied from interface:RequestAdds a listener for idle timeouts.
The listener is a predicate function that should return
trueto indicate that the idle timeout should be handled by the container as a hard failure (seeRequest.addFailureListener(Consumer)); orfalseto ignore that specific timeout and for another timeout to occur after another idle period.Any pending
Request.demand(Runnable)orResponse.write(boolean, ByteBuffer, Callback)operations are not affected by this call. Applications need to be mindful of any such pending operations if attempting to make new operations.Listeners are processed in sequence, and the first that returns
truestops the processing of subsequent listeners, which are therefore not invoked.- Specified by:
addIdleTimeoutListenerin interfaceRequest- Overrides:
addIdleTimeoutListenerin classRequest.Wrapper- Parameters:
onIdleTimeout- the predicate function- See Also:
-
addFailureListener
Description copied from interface:RequestAdds a listener for asynchronous hard errors.
When a listener is called, the effects of the error will already have taken place:
- Pending
Request.demand(Runnable)will be woken up. - Calls to
Request.read()will return theThrowable. - Pending and new
Response.write(boolean, ByteBuffer, Callback)calls will be failed by callingCallback.failed(Throwable)on the callback passed towrite(...). - Any call to
Callback.succeeded()on the callback passed toRequest.Handler.handle(Request, Response, Callback)will effectively be a call toCallback.failed(Throwable)with the notifiedThrowable.
Listeners are processed in sequence. When all listeners are invoked then
Callback.failed(Throwable)will be called on the callback passed toRequest.Handler.handle(Request, Response, Callback).- Specified by:
addFailureListenerin interfaceRequest- Overrides:
addFailureListenerin classRequest.Wrapper- Parameters:
onFailure- the consumer function- See Also:
- Pending
-
getContext
Description copied from interface:RequestGet theContextassociated with thisRequest.Note that a
Requestshould always have an associatedContextsince if theRequestis not being handled by aContextHandlerthen theContextfromServer.getContext()will be used.- Specified by:
getContextin interfaceRequest- Overrides:
getContextin classRequest.Wrapper- Returns:
- the
Contextassociated with thisRequest. Nevernull. - See Also:
-