public class JavassistProxyGenerator extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<Class<?>> |
EXCLUDED_CLASSES |
| Constructor and Description |
|---|
JavassistProxyGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clearClassCache()
Method clears cached classes.
|
static void |
clearMethodClassificationCache()
Method clears method classification cache that keeps direct references from proxied class methods to their
implementation in the form of
PredicateMethodClassification.invocationHandler. |
static Class<?> |
getProxyClass(Class<?>... interfaces)
Returns previously created class or construct new from the passed interfaces.
|
static <T> T |
instantiate(javassist.util.proxy.MethodHandler methodHandler,
Class<?>... interfaces)
Method creates and instantiates new proxy object with passed set of interfaces and the invocation handler.
|
static <T> T |
instantiate(javassist.util.proxy.MethodHandler methodHandler,
Class<?>[] interfaces,
Class<?>[] constructorTypes,
Object[] constructorArgs)
Method creates and instantiates new proxy object with passed set of interfaces and the invocation handler.
|
static <T> T |
instantiate(ProxyRecipe proxyRecipe,
Object proxyState)
Method creates and instantiates new proxy object defined by passed
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. |
static <T> T |
instantiate(ProxyRecipe proxyRecipe,
Object proxyState,
Class<?>[] constructorTypes,
Object[] constructorArgs)
Method creates and instantiates new proxy object defined by passed
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. |
static <T> T |
instantiateSerializable(ProxyRecipe proxyRecipe,
ProxyStateWithConstructorArgs proxyState,
Class<?>[] constructorTypes,
Object[] constructorArgs)
Method creates and instantiates new proxy object defined by passed
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. |
static <T> T |
instantiateSerializable(ProxyRecipe proxyRecipe,
Serializable proxyState)
Method creates and instantiates new proxy object defined by passed
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. |
public static void clearMethodClassificationCache()
PredicateMethodClassification.invocationHandler. This cache
speeds up method execution heavily.public static void clearClassCache()
ClassLoader
and old JVMs were not able to purge non-used classes from the ClassLoader -
see this answer>.
This cache allows reusing already generated classes for same combination of input interfaces / combination of
CacheKeyProvider classifiers.public static <T> T instantiate(javassist.util.proxy.MethodHandler methodHandler,
Class<?>... interfaces)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateJavassistProxy(java.lang.Class)
for example usage.public static <T> T instantiate(javassist.util.proxy.MethodHandler methodHandler,
Class<?>[] interfaces,
Class<?>[] constructorTypes,
Object[] constructorArgs)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateJavassistProxy(java.lang.Class)
for example usage.public static <T> T instantiate(ProxyRecipe proxyRecipe, Object proxyState, Class<?>[] constructorTypes, Object[] constructorArgs)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiate(ProxyRecipe proxyRecipe, Object proxyState)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiateSerializable(ProxyRecipe proxyRecipe, Serializable proxyState)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static <T> T instantiateSerializable(ProxyRecipe proxyRecipe, ProxyStateWithConstructorArgs proxyState, Class<?>[] constructorTypes, Object[] constructorArgs)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static Class<?> getProxyClass(Class<?>... interfaces)
Copyright © 2024 FG Forrest, a.s.. All rights reserved.