org.unitils.mock.core.proxy
Class CglibProxyMethodInterceptor.CglibProxyInvocation

java.lang.Object
  extended by org.unitils.mock.core.proxy.ProxyInvocation
      extended by org.unitils.mock.core.proxy.CglibProxyMethodInterceptor.CglibProxyInvocation
Enclosing class:
CglibProxyMethodInterceptor<T>

public static class CglibProxyMethodInterceptor.CglibProxyInvocation
extends ProxyInvocation

An invocation implementation that uses the cglib method proxy to be able to invoke the original behavior.


Constructor Summary
CglibProxyMethodInterceptor.CglibProxyInvocation(String mockName, Method method, List<Object> arguments, StackTraceElement[] invokedAt, Object proxy, net.sf.cglib.proxy.MethodProxy methodProxy)
          Creates an invocation.
 
Method Summary
 Object invokeOriginalBehavior()
          Invokes the original behavior by calling the method proxy.
 
Methods inherited from class org.unitils.mock.core.proxy.ProxyInvocation
getArguments, getArgumentsAtInvocationTime, getInvokedAt, getInvokedAtTrace, getLineNumber, getMethod, getMockName, getNrOfNotNullArguments, getProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CglibProxyMethodInterceptor.CglibProxyInvocation

public CglibProxyMethodInterceptor.CglibProxyInvocation(String mockName,
                                                        Method method,
                                                        List<Object> arguments,
                                                        StackTraceElement[] invokedAt,
                                                        Object proxy,
                                                        net.sf.cglib.proxy.MethodProxy methodProxy)
Creates an invocation.

Parameters:
mockName - The name of the mock, not null
method - The method that was called, not null
arguments - The arguments that were used, not null
invokedAt - The location of the invocation, not null
proxy - The proxy, not null
methodProxy - The cglib method proxy, not null
Method Detail

invokeOriginalBehavior

public Object invokeOriginalBehavior()
                              throws Throwable
Invokes the original behavior by calling the method proxy. If there is no original behavior, e.g. an interface or abstract method, an exception is raised.

Overrides:
invokeOriginalBehavior in class ProxyInvocation
Returns:
The result value
Throws:
Throwable


Copyright © 2011. All Rights Reserved.