Package org.kohsuke.stapler.interceptor
Class Interceptor
java.lang.Object
org.kohsuke.stapler.interceptor.Interceptor
- Direct Known Subclasses:
HttpVerbInterceptor
,JsonOutputFilter.Processor
,JsonResponse.Handler
,LimitedTo.Processor
,RequirePOST.Processor
,RespondSuccess.Processor
Intercepts the domain method call from Stapler.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninvoke
(StaplerRequest2 request, StaplerResponse2 response, Object instance, Object[] arguments) Intercepts the call.invoke
(StaplerRequest request, StaplerResponse response, Object instance, Object[] arguments) Deprecated.void
Called by Stapler to set up the target of the interceptor.
-
Field Details
-
target
-
-
Constructor Details
-
Interceptor
public Interceptor()
-
-
Method Details
-
setTarget
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 Object invoke(StaplerRequest2 request, StaplerResponse2 response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, jakarta.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.- Parameters:
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.- Returns:
- Return value from the method.
- Throws:
InvocationTargetException
- if you want to send e.g. something fromHttpResponses
CancelRequestHandlingException
- to cancel this request handling and moves on to the next available dispatch mechanism.IllegalAccessException
jakarta.servlet.ServletException
-
invoke
@Deprecated public Object invoke(StaplerRequest request, StaplerResponse response, Object instance, Object[] arguments) throws IllegalAccessException, InvocationTargetException, javax.servlet.ServletException Deprecated.- Throws:
IllegalAccessException
InvocationTargetException
javax.servlet.ServletException
-
invoke(StaplerRequest2, StaplerResponse2, Object, Object[])