public class ProxyFactory extends Object
| Constructor and Description |
|---|
ProxyFactory(PreInterceptor preInterceptor,
Set<String> proxyCreatorMethods,
Set<String> freeFromInterceptionMethods)
Constructor with PreInterceptor, which will be called before the method's invocation, list of method names
which will skip the PreInterceptor invocation and a list of method names that will return a proxy of the returned
object.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createProxyFromOriginal(T original)
Method to generate a proxy from a given object.
|
static boolean |
isNamingPolicyDefined() |
static void |
setNamingPolicy(String descriptor) |
static void |
setNamingPolicyIfAbsent(String descriptor) |
public ProxyFactory(PreInterceptor preInterceptor, Set<String> proxyCreatorMethods, Set<String> freeFromInterceptionMethods)
Constructor with PreInterceptor, which will be called before the method's invocation, list of method names which will skip the PreInterceptor invocation and a list of method names that will return a proxy of the returned object.
Notice that it's responsible of the developer using this class to ensure all the methods in the proxyCreatorMethods return a class that can be proxied. This action is performed unsafely by this class
preInterceptor - PreInterceptor with the desired behaviour before the method's invocationproxyCreatorMethods - list of method names that will return a proxy of the returned objectfreeFromInterceptionMethods - list of methods names that will skip the PreInterceptor invocationPreInterceptorpublic static boolean isNamingPolicyDefined()
public static void setNamingPolicy(String descriptor)
public static void setNamingPolicyIfAbsent(String descriptor)
public <T> T createProxyFromOriginal(T original)
Method to generate a proxy from a given object.
Please notice it won't create a new instance. Instead it will create a wrapper that will actually invoke the method on the original object
T - Ooiginal's classoriginal - object to be proxiedCopyright © 2018. All rights reserved.