Class Rule.Handler

java.lang.Object
org.eclipse.jetty.util.Attributes.Wrapper
org.eclipse.jetty.server.Request.Wrapper
org.eclipse.jetty.rewrite.handler.Rule.Handler
All Implemented Interfaces:
org.eclipse.jetty.io.Content.Source, org.eclipse.jetty.server.Request, org.eclipse.jetty.server.Request.Handler, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.util.thread.Invocable
Direct Known Subclasses:
Rule.HttpURIHandler
Enclosing class:
Rule

public static class Rule.Handler extends org.eclipse.jetty.server.Request.Wrapper implements org.eclipse.jetty.server.Request.Handler

A Request.Wrapper that is also a Request.Handler, used to chain a sequence of Rules together. The rule handler is initialized with the initial request, then it is passed to a chain of rules before the child Handler is passed in setHandler(Handler). Finally, the response and callback are provided in a call to handle(Request, Response, Callback), which calls the handle(Response, Callback).

  • 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.Wrapper

    Nested 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.Task

    Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Request

    org.eclipse.jetty.server.Request.AuthenticationState, org.eclipse.jetty.server.Request.Handler, org.eclipse.jetty.server.Request.ServeAs, org.eclipse.jetty.server.Request.Wrapper
  • Field Summary

    Fields inherited from interface org.eclipse.jetty.util.Attributes

    NULL

    Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

    __nonBlocking, NOOP

    Fields inherited from interface org.eclipse.jetty.server.Request

    CACHE_ATTRIBUTE, COOKIE_ATTRIBUTE, DEFAULT_LOCALES
  • Constructor Summary

    Constructors
    Constructor
    Description
    Handler(org.eclipse.jetty.server.Request request)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    handle(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback)
     
    protected boolean
    handle(org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback)
    Handles this wrapped request together with the passed response and callback, using the handler set in setHandler(Handler).
    void
    setHandler(org.eclipse.jetty.server.Request.Handler handler)
    Wraps the given Handler within this instance and returns this instance.

    Methods inherited from class org.eclipse.jetty.server.Request.Wrapper

    addFailureListener, addHttpStreamWrapper, addIdleTimeoutListener, consumeAvailable, demand, fail, getBeginNanoTime, getComponents, getConnectionMetaData, getContext, getHeaders, getHeadersNanoTime, getHttpURI, getId, getLength, getMethod, getSession, getTrailers, getTunnelSupport, getWrapped, isSecure, push, read

    Methods inherited from class org.eclipse.jetty.util.Attributes.Wrapper

    clearAttributes, equals, getAttribute, getAttributeNameSet, hashCode, removeAttribute, setAttribute

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.Attributes

    asAttributeMap, clearAttributes, getAttribute, getAttributeNameSet, removeAttribute, setAttribute

    Methods inherited from interface org.eclipse.jetty.io.Content.Source

    fail, rewind

    Methods inherited from interface org.eclipse.jetty.util.thread.Invocable

    getInvocationType
  • Constructor Details

    • Handler

      public Handler(org.eclipse.jetty.server.Request request)
  • Method Details

    • handle

      public boolean handle(org.eclipse.jetty.server.Request request, org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback) throws Exception
      Specified by:
      handle in interface org.eclipse.jetty.server.Request.Handler
      Throws:
      Exception
    • handle

      protected boolean handle(org.eclipse.jetty.server.Response response, org.eclipse.jetty.util.Callback callback) throws Exception

      Handles this wrapped request together with the passed response and callback, using the handler set in setHandler(Handler). This method should be extended if additional handling of the wrapped request is required.

      Parameters:
      response - The response
      callback - The callback
      Throws:
      Exception - If there is a problem handling
      See Also:
    • setHandler

      public void setHandler(org.eclipse.jetty.server.Request.Handler handler)

      Wraps the given Handler within this instance and returns this instance.

      Parameters:
      handler - the Handler to wrap