org.kohsuke.stapler.interceptor
Class Interceptor

java.lang.Object
  extended by org.kohsuke.stapler.interceptor.Interceptor
Direct Known Subclasses:
LimitedTo.Processor, RequirePOST.Processor

public abstract class Interceptor
extends java.lang.Object

Intercepts the domain method call from Stapler.

Author:
Kohsuke Kawaguchi
See Also:
InterceptorAnnotation

Field Summary
protected  Function target
           
 
Constructor Summary
Interceptor()
           
 
Method Summary
abstract  java.lang.Object invoke(StaplerRequest request, StaplerResponse response, java.lang.Object instance, java.lang.Object[] arguments)
          Intercepts the call.
 void setTarget(Function target)
          Called by Stapler to set up the target of the interceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected Function target
Constructor Detail

Interceptor

public Interceptor()
Method Detail

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 java.lang.Object invoke(StaplerRequest request,
                                        StaplerResponse response,
                                        java.lang.Object instance,
                                        java.lang.Object[] arguments)
                                 throws java.lang.IllegalAccessException,
                                        java.lang.reflect.InvocationTargetException
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:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException


Copyright © 2012. All Rights Reserved.