| java.lang.Object org.mockejb.interceptor.InterceptableProxy
InterceptableProxy | public class InterceptableProxy implements MethodInterceptor(Code) | | Creates dynamic proxy and acts as an InvocationHandler for
this proxy. During invocation, obtains relevant interceptors from
AspectSystem and makes them part of the invocation chain.
Uses Cglib internally.
Use this class when you have an interface/class and a single implementation class
for this interface.
Usage example:
(Context) InterceptableProxy.create(
Context.class, new MockContext() );
You can also create proxies for classes (including using the same class
as the intercepted and target class) :
InterceptableTestClass proxy = (InterceptableTestClass)
InterceptableProxy.create( TestImpl.class, new TestImpl() );
Note that implementation classes don't have to be public (cglib feature).
author: Alexander Ananiev |
|
|