public class InterceptedSubclassFactory<T> extends ProxyFactory<T>
| Modifier and Type | Field and Description |
|---|---|
static String |
PROXY_SUFFIX |
CONSTRUCTED_FLAG_NAME, DEFAULT_METHOD_RESOLVER, DEFAULT_PROXY_PACKAGE, INIT_METHOD_NAME, LBEAN_IDENTIFIER, LJAVA_LANG_BYTE, LJAVA_LANG_CLASS, LJAVA_LANG_OBJECT, LJAVA_LANG_REFLECT_METHOD, LJAVA_LANG_STRING, LJAVA_LANG_THREAD_LOCAL, METHOD_HANDLER_FIELD_NAME| Constructor and Description |
|---|
InterceptedSubclassFactory(String contextId,
Class<?> proxiedBeanType,
Set<? extends Type> typeClosure,
javax.enterprise.inject.spi.Bean<?> bean,
Set<MethodSignature> enhancedMethodSignatures,
Set<MethodSignature> interceptedMethodSignatures) |
InterceptedSubclassFactory(String contextId,
Class<?> proxiedBeanType,
Set<? extends Type> typeClosure,
String proxyName,
javax.enterprise.inject.spi.Bean<?> bean,
Set<MethodSignature> enhancedMethodSignatures,
Set<MethodSignature> interceptedMethodSignatures)
Creates a new proxy factory when the name of the proxy class is already
known, such as during de-serialization
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInterfacesFromTypeClosure(Set<? extends Type> typeClosure,
Class<?> proxiedBeanType) |
protected void |
addMethods(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor) |
protected void |
addMethodsFromClass(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor) |
protected void |
addSpecialMethods(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor)
Adds methods requiring special implementations rather than just
delegation.
|
protected void |
createForwardingMethodBody(org.jboss.classfilewriter.ClassMethod classMethod,
MethodInformation method,
org.jboss.classfilewriter.ClassMethod staticConstructor) |
protected void |
createInterceptorBody(org.jboss.classfilewriter.ClassMethod method,
MethodInformation methodInfo,
boolean delegateToSuper,
org.jboss.classfilewriter.ClassMethod staticConstructor)
Creates the given method on the proxy class where the implementation
forwards the call directly to the method handler.
|
Class<?> |
getBeanType() |
protected Class<? extends MethodHandler> |
getMethodHandlerType() |
protected String |
getProxyNameSuffix()
Returns a suffix to append to the name of the proxy class.
|
protected void |
invokeMethodHandler(org.jboss.classfilewriter.ClassMethod method,
MethodInformation methodInfo,
boolean addReturnInstruction,
BytecodeMethodResolver bytecodeMethodResolver,
boolean addProceed,
org.jboss.classfilewriter.ClassMethod staticConstructor)
calls methodHandler.invoke for a given method
|
addAdditionalInterfaces, addConstructedGuardToMethodBody, addConstructedGuardToMethodBody, addConstructors, addFields, addInterface, addSerializationSupport, create, createInterceptorBody, createSpecialMethodBody, generateEqualsMethod, generateGetMethodHandlerBody, generateHashCodeMethod, generateSetMethodHandlerBody, getAdditionalInterfaces, getBaseProxyName, getBean, getContextId, getMethodHandlerField, getProxyClass, invokeMethodHandler, isMethodAccepted, isProxy, resolveClassLoaderForBeanProxy, run, setBeanInstancepublic static final String PROXY_SUFFIX
public InterceptedSubclassFactory(String contextId, Class<?> proxiedBeanType, Set<? extends Type> typeClosure, javax.enterprise.inject.spi.Bean<?> bean, Set<MethodSignature> enhancedMethodSignatures, Set<MethodSignature> interceptedMethodSignatures)
public InterceptedSubclassFactory(String contextId, Class<?> proxiedBeanType, Set<? extends Type> typeClosure, String proxyName, javax.enterprise.inject.spi.Bean<?> bean, Set<MethodSignature> enhancedMethodSignatures, Set<MethodSignature> interceptedMethodSignatures)
proxiedBeanType - the super-class for this proxy classtypeClosure - the bean types of the beanenhancedMethodSignatures - a restricted set of methods that need to be interceptedpublic void addInterfacesFromTypeClosure(Set<? extends Type> typeClosure, Class<?> proxiedBeanType)
addInterfacesFromTypeClosure in class ProxyFactory<T>protected String getProxyNameSuffix()
getProxyNameSuffix in class ProxyFactory<T>protected void addMethods(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor)
addMethods in class ProxyFactory<T>protected void addMethodsFromClass(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor)
addMethodsFromClass in class ProxyFactory<T>protected void createForwardingMethodBody(org.jboss.classfilewriter.ClassMethod classMethod,
MethodInformation method,
org.jboss.classfilewriter.ClassMethod staticConstructor)
createForwardingMethodBody in class ProxyFactory<T>protected void createInterceptorBody(org.jboss.classfilewriter.ClassMethod method,
MethodInformation methodInfo,
boolean delegateToSuper,
org.jboss.classfilewriter.ClassMethod staticConstructor)
methodInfo - any JLR methoddelegateToSuper - protected void invokeMethodHandler(org.jboss.classfilewriter.ClassMethod method,
MethodInformation methodInfo,
boolean addReturnInstruction,
BytecodeMethodResolver bytecodeMethodResolver,
boolean addProceed,
org.jboss.classfilewriter.ClassMethod staticConstructor)
methodInfo - declaring class of the methodaddReturnInstruction - set to true you want to return the result ofbytecodeMethodResolver - The method resolveraddProceed - protected void addSpecialMethods(org.jboss.classfilewriter.ClassFile proxyClassType,
org.jboss.classfilewriter.ClassMethod staticConstructor)
addSpecialMethods in class ProxyFactory<T>proxyClassType - the Javassist class description for the proxy typepublic Class<?> getBeanType()
getBeanType in class ProxyFactory<T>protected Class<? extends MethodHandler> getMethodHandlerType()
getMethodHandlerType in class ProxyFactory<T>Copyright © 2017. All rights reserved.