public interface ProxyFactory
A factory interface for creating different types of proxies.
| 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> proxyClass,
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> proxyClass,
ProxyHandler<T> handler)
Creates a proxy where method invocations on the proxy are passed to a single
invoke method on the ProxyHandler. |
<T> T |
createProxy(Class<T> proxyClass,
T target,
Class<? extends Annotation> marker,
org.aopalliance.intercept.MethodInterceptor... interceptors)
Creates a "protection" proxy where method invocations on the proxy are intercepted by the
chain of
MethodInterceptors before (optionally) being invoked on the target. |
<T> T createProxy(Class<T> proxyClass, javax.inject.Provider<T> provider) throws GenerationException
T - The proxy typeproxyClass - The proxied classprovider - The provider of the proxied objectGenerationException - If an error occurs creating the proxy<T> T createProxy(Class<T> proxyClass, ProxyHandler<T> handler) throws GenerationException
invoke method on the ProxyHandler.T - The proxy typeproxyClass - The proxied interface classhandler - The handler for the method invocationGenerationException - If an error occurs creating the proxyObject createProxy(Class<?>[] proxyInterfaces, ProxyHandler<?> handler) throws GenerationException
invoke 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 proxy<T> T createProxy(Class<T> proxyClass, T target, Class<? extends Annotation> marker, org.aopalliance.intercept.MethodInterceptor... interceptors) throws GenerationException
MethodInterceptors before (optionally) being invoked on the target.T - The proxy typeproxyClass - The proxy classtarget - The target of the invocationmarker - The annotation that marks intercepted methodsinterceptors - One or more method interceptors, which are called in orderGenerationException - If an error occurs creating the proxy<T> InterceptorBuilder<T> buildInterceptor(Class<T> proxyClass)
T - The proxy typeproxyClass - The class of the proxy (and target)Copyright © 2014. All rights reserved.