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.util.Attributes
Direct Known Subclasses:
Rule.HttpURIHandler
Enclosing class:
Rule

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

A Request.Wrapper used to chain a sequence of Rules together.

The first Rule.Handler is initialized with the initial Request, then it is passed to a chain of Rules, which in turn chain Rule.Handlers together. At the end of the Rule applications, Rule.Handlers are chained so that so that the first rule produces the innermost Handler and the last rule produces the outermost Handler in this way: RH3(RH2(RH1(Req))).

After the Rule applications, the Rule.Handlers are then called in sequence, starting from the innermost and moving outwards with respect to the wrapping, until finally the Request.Handler.handle(Request, Response, Callback) method of the child Handler of RewriteHandler is invoked.

  • 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.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.server.Request

    CACHE_ATTRIBUTE, COOKIE_ATTRIBUTE, DEFAULT_LOCALES
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    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.

    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
  • Constructor Details

    • Handler

      protected Handler(org.eclipse.jetty.server.Request request)
    • Handler

      public Handler(Rule.Handler handler)
  • Method Details

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

      This method should be overridden only if the rule applies to the response, or the rule completes the callback. By default this method forwards the handling to the next Rule.Handler. If a rule that overrides this method is non-terminating, it should call the super implementation to chain the rules.

      Parameters:
      response - the Response
      callback - the Callback
      Throws:
      Exception - if there is a failure while handling the rules