public class ByteBuddyProxyGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ByteBuddyProxyGenerator.ProxyRecipeDeserializationProxyFactory |
| Modifier and Type | Field and Description |
|---|---|
static Set<Class<?>> |
EXCLUDED_CLASSES |
static String |
INVOCATION_HANDLER_FIELD |
| Constructor and Description |
|---|
ByteBuddyProxyGenerator() |
| 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 Class<?> |
getProxyClass(Class<?>[] interfaces,
Class<?>[] constructorArguments)
Returns previously created class or construct new from the passed interfaces.
|
static Class<?> |
getProxyClass(Class<?>[] interfaces,
Class<?>[] constructorArguments,
ClassLoader classLoader)
Returns previously created class or construct new from the passed interfaces.
|
static Class<?> |
getProxyClass(Class<?>[] interfaces,
ClassLoader classLoader)
Returns previously created class or construct new from the passed interfaces.
|
static <T> T |
instantiate(DispatcherInvocationHandler invocationHandler,
Class<?>... interfaces)
Method creates and instantiates new proxy object with passed set of interfaces and the invocation handler.
|
static <T> T |
instantiate(DispatcherInvocationHandler invocationHandler,
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(DispatcherInvocationHandler invocationHandler,
Class<?>[] interfaces,
Class<?>[] constructorTypes,
Object[] constructorArgs,
ClassLoader classLoader)
Method creates and instantiates new proxy object with passed set of interfaces and the invocation handler.
|
static <T> T |
instantiate(DispatcherInvocationHandler invocationHandler,
Class<?>[] interfaces,
ClassLoader classLoader)
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 |
instantiate(ProxyRecipe proxyRecipe,
Object proxyState,
Class<?>[] constructorTypes,
Object[] constructorArgs,
ClassLoader classLoader)
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,
ClassLoader classLoader)
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. |
static <T> T |
instantiateSerializable(ProxyRecipe proxyRecipe,
Serializable proxyState,
Class<?>[] constructorTypes,
Object[] constructorArgs,
ClassLoader classLoader)
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,
ClassLoader classLoader)
Method creates and instantiates new proxy object defined by passed
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. |
public static final String INVOCATION_HANDLER_FIELD
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(@Nonnull DispatcherInvocationHandler invocationHandler, @Nonnull Class<?>... interfaces)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateByteBuddyProxy(java.lang.Class)
for example usage.public static <T> T instantiate(@Nonnull DispatcherInvocationHandler invocationHandler, @Nonnull Class<?>[] interfaces, @Nonnull ClassLoader classLoader)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateByteBuddyProxy(java.lang.Class)
for example usage.public static <T> T instantiate(@Nonnull DispatcherInvocationHandler invocationHandler, @Nonnull Class<?>[] interfaces, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateByteBuddyProxy(java.lang.Class)
for example usage.public static <T> T instantiate(@Nonnull DispatcherInvocationHandler invocationHandler, @Nonnull Class<?>[] interfaces, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs, @Nonnull ClassLoader classLoader)
com.fg.edee.proxy.model.traits.GenericBucketProxyGenerator#instantiateByteBuddyProxy(java.lang.Class)
for example usage.public static <T> T instantiate(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Object proxyState)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiate(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Object proxyState, @Nonnull ClassLoader classLoader)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiate(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Object proxyState, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiate(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Object proxyState, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs, @Nonnull ClassLoader classLoader)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is not Serializable.public static <T> T instantiateSerializable(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Serializable proxyState)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static <T> T instantiateSerializable(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Serializable proxyState, @Nonnull ClassLoader classLoader)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static <T> T instantiateSerializable(@Nonnull ProxyRecipe proxyRecipe, @Nonnull ProxyStateWithConstructorArgs proxyState, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static <T> T instantiateSerializable(@Nonnull ProxyRecipe proxyRecipe, @Nonnull Serializable proxyState, @Nonnull Class<?>[] constructorTypes, @Nonnull Object[] constructorArgs, @Nonnull ClassLoader classLoader)
ProxyRecipe and uses passed `proxyState`
object as proxy internal memory. The created proxy is Serializable.public static Class<?> getProxyClass(@Nonnull Class<?>[] interfaces, @Nonnull Class<?>[] constructorArguments)
public static Class<?> getProxyClass(@Nonnull Class<?>[] interfaces, @Nonnull Class<?>[] constructorArguments, @Nonnull ClassLoader classLoader)
public static Class<?> getProxyClass(@Nonnull Class<?>... interfaces)
public static Class<?> getProxyClass(@Nonnull Class<?>[] interfaces, @Nonnull ClassLoader classLoader)
Copyright © 2022 FG Forrest, a.s.. All rights reserved.