public class JdkProxyFactory extends BaseProxyFactory
| Constructor and Description |
|---|
JdkProxyFactory() |
JdkProxyFactory(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> proxyInterface,
javax.inject.Provider<T> provider)
The proxy class (first argument) must be an interface, or an
IllegalArgumentException will be thrown. |
<T> T |
createProxy(Class<T> proxyInterface,
ProxyHandler<T> handler)
The proxy class (first argument) must be an interface, or an
IllegalArgumentException will be thrown. |
assertClassVisible, assertInterfaces, createProxy, getNamingStrategy, getPreferredClassLoader, getProxyClassLoader, setNamingStrategypublic JdkProxyFactory()
@Inject public JdkProxyFactory(ClassLoader loader)
public <T> T createProxy(Class<T> proxyInterface, javax.inject.Provider<T> provider) throws GenerationException
IllegalArgumentException will be thrown.T - The proxy typeproxyInterface - 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> proxyInterface, ProxyHandler<T> handler) throws GenerationException
IllegalArgumentException will be thrown.T - The proxy typeproxyInterface - 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.