- All Implemented Interfaces:
- net.sf.cglib.proxy.Callback, net.sf.cglib.proxy.MethodInterceptor
public class InterceptableProxy
extends java.lang.Object
implements net.sf.cglib.proxy.MethodInterceptor
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