Class Interceptor

Direct Known Subclasses:
HttpVerbInterceptor, JsonOutputFilter.Processor, JsonResponse.Handler, LimitedTo.Processor, RequirePOST.Processor, RespondSuccess.Processor

public abstract class Interceptor extends Object
Intercepts the domain method call from Stapler.
Kohsuke Kawaguchi
See Also:
  • Field Details

  • Constructor Details

    • Interceptor

      public Interceptor()
  • Method Details

    • setTarget

      public void setTarget(Function target)
      Called by Stapler to set up the target of the interceptor. This function object represents a method on which your annotation is placed. This happens once before this instance takes any calls.
    • invoke

      public abstract Object invoke(StaplerRequest request, StaplerResponse response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, javax.servlet.ServletException
      Intercepts the call.

      The minimal no-op interceptor would do target.invoke(request,response,instance,arguments), but the implementation is free to do additional pre/post processing.

      request - The current request we are processing.
      response - The current response object.
      instance - The domain object instance whose method we are about to invoke.
      arguments - Arguments of the method call.
      Return value from the method.
      InvocationTargetException - if you want to send e.g. something from HttpResponses
      CancelRequestHandlingException - to cancel this request handling and moves on to the next available dispatch mechanism.