public class JavassistProxyFactory extends BaseProxyFactory
ProxyFactory implementation using
Javassist.
| Constructor and Description |
|---|
JavassistProxyFactory() |
JavassistProxyFactory(ClassLoader loader) |
| Modifier and Type | Method and Description |
|---|---|
<T> InterceptorBuilder<T> |
buildInterceptor(Class<T> proxyClass)
Creates a new builder for constructing an interceptor or "protection" proxy.
|
Object |
createProxy(Class<?>[] proxyInterfaces,
ProxyHandler<?> handler)
Creates a proxy that implements multiple interfaces where invocations on that proxy are
passed to a single
invoke method on the ProxyHandler. |
<T> T |
createProxy(Class<T> proxyType,
javax.inject.Provider<T> provider)
Creates a "virtual" proxy where method invocations on the proxy are delegated
to the provided instance.
|
<T> T |
createProxy(Class<T> proxyType,
ProxyHandler<T> handler)
Creates a proxy where method invocations on the proxy are passed to a single
invoke method on the ProxyHandler. |
assertClassVisible, assertInterfaces, createProxy, getNamingStrategy, getPreferredClassLoader, getProxyClassLoader, setNamingStrategypublic JavassistProxyFactory()
@Inject public JavassistProxyFactory(ClassLoader loader)
public <T> T createProxy(Class<T> proxyType, javax.inject.Provider<T> provider) throws GenerationException
ProxyFactoryT - The proxy typeproxyType - The proxied classprovider - The provider of the proxied objectGenerationException - If an error occurs creating the proxyProxyFactory.createProxy(Class, javax.inject.Provider)public <T> T createProxy(Class<T> proxyType, ProxyHandler<T> handler) throws GenerationException
ProxyFactoryinvoke method on the ProxyHandler.T - The proxy typeproxyType - The proxied interface classhandler - The handler for the method invocationGenerationException - If an error occurs creating the proxyProxyFactory.createProxy(Class, org.proxy4j.core.ProxyHandler)public Object createProxy(Class<?>[] proxyInterfaces, ProxyHandler<?> handler) throws GenerationException
ProxyFactoryinvoke method on the ProxyHandler. Equivalent to
the traditional JDK proxy creation method:
Proxy.newProxyInstance(ClassLoader, Class[], java.lang.reflect.InvocationHandler).proxyInterfaces - The interfaces that the proxy class must implementhandler - The handler for the method invocationGenerationException - If an error occurs creating the proxyProxyFactory.createProxy(Class[], org.proxy4j.core.ProxyHandler)public <T> InterceptorBuilder<T> buildInterceptor(Class<T> proxyClass)
ProxyFactoryT - The proxy typeproxyClass - The class of the proxy (and target)ProxyFactory.buildInterceptor(Class)Copyright © 2014. All rights reserved.