- 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.SyntheticNested 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.AttributesWrapper, 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
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 fatal failures.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, asAttributeMap, clearAttributes, consumeAvailable, fail, getAttribute, getAttributeNameSet, getBeginNanoTime, getComponents, getConnectionMetaData, getHeaders, getHeadersNanoTime, getHttpURI, getId, getLength, getMethod, getSession, getTrailers, getTunnelSupport, getWrapped, isSecure, push, read, removeAttribute, setAttribute, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Attributes
equals, hashCodeMethods 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.- 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 fatal failure (seeRequest.addFailureListener(Consumer)); orfalseto ignore that specific timeout and for another timeout to occur after another idle period.Idle timeout listeners are only invoked if there are no pending
Request.demand(Runnable)orResponse.write(boolean, ByteBuffer, Callback)operations.Listeners are processed in the same order they are added, 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 idle timeout listener as a predicate function- See Also:
-
addFailureListener
Description copied from interface:RequestAdds a listener for asynchronous fatal failures.
When a listener is called, the effects of the failure have already taken place:
- Pending
Request.demand(Runnable)have been woken up. - Calls to
Request.read()will return theThrowablefailure. - Pending and new
Response.write(boolean, ByteBuffer, Callback)calls will be failed by callingCallback.failed(Throwable)on the callback passed toResponse.write(boolean, ByteBuffer, Callback).
Listeners are processed in the same order they are added.
- Specified by:
addFailureListenerin interfaceRequest- Overrides:
addFailureListenerin classRequest.Wrapper- Parameters:
onFailure- the failure listener as a 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:
-