Class MethodInvokingInterceptor

  • All Implemented Interfaces:
    Interceptor

    public final class MethodInvokingInterceptor
    extends Object
    implements Interceptor
    An interceptor which always invokes one specific method on one specific object given the parameters from the invocation context.
    Author:
    David M. Lloyd
    • Constructor Detail

      • MethodInvokingInterceptor

        public MethodInvokingInterceptor​(Object target,
                                         Method method)
        Construct a new instance.
        Parameters:
        target - the object upon which invocation should take place
        method - the method to invoke
    • Method Detail

      • processInvocation

        public Object processInvocation​(InterceptorContext context)
                                 throws Exception
        Process an invocation. The invocation can be handled directly, or passed on to the next processor in the chain.
        Specified by:
        processInvocation in interface Interceptor
        Parameters:
        context - the interceptor context
        Returns:
        the result of the invocation
        Throws:
        Exception - If the underlying invocation resulted in some exception