Package org.jboss.weld.bean.proxy
Class DecoratorProxyFactory<T>
- java.lang.Object
-
- org.jboss.weld.bean.proxy.ProxyFactory<T>
-
- org.jboss.weld.bean.proxy.DecoratorProxyFactory<T>
-
- All Implemented Interfaces:
PrivilegedAction<T>
public class DecoratorProxyFactory<T> extends ProxyFactory<T>
This special proxy factory is mostly used for abstract decorators. When a delegate field is injected, the abstract methods directly invoke the corresponding method on the delegate. All other cases forward the calls to theBeanInstance
for further processing.- Author:
- David Allen, Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DecoratorProxyFactory.TargetInstanceBytecodeMethodResolver
-
Field Summary
Fields Modifier and Type Field Description static String
PROXY_SUFFIX
-
Fields inherited from class org.jboss.weld.bean.proxy.ProxyFactory
CONSTRUCTED_FLAG_NAME, DEFAULT_METHOD_RESOLVER, DEFAULT_PROXY_PACKAGE, INIT_METHOD_NAME, INVOKE_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, WELD_PROXY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description DecoratorProxyFactory(String contextId, Class<T> proxyType, WeldInjectionPointAttributes<?,?> delegateInjectionPoint, jakarta.enterprise.inject.spi.Bean<?> bean)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAdditionalInterfaces(Set<Class<?>> interfaces)
Sub classes may override to specify additional interfaces the proxy should implementprotected void
addMethodsFromClass(org.jboss.classfilewriter.ClassFile proxyClassType, org.jboss.classfilewriter.ClassMethod staticConstructor)
protected String
getProxyNameSuffix()
Returns a suffix to append to the name of the proxy class.protected boolean
isUsingProxyInstantiator()
-
Methods inherited from class org.jboss.weld.bean.proxy.ProxyFactory
addConstructedGuardToMethodBody, addConstructedGuardToMethodBody, addConstructors, addFields, addInterface, addInterfacesFromTypeClosure, addMethods, addSerializationSupport, addSpecialMethods, create, createForwardingMethodBody, createInterceptorBody, createSpecialMethodBody, generateEqualsMethod, generateGetMethodHandlerBody, generateHashCodeMethod, generateSetMethodHandlerBody, getAdditionalInterfaces, getBaseProxyName, getBean, getBeanType, getContextId, getMethodHandlerField, getMethodHandlerType, getProxiedBeanType, getProxyClass, getProxySuperclass, invokeMethodHandler, isMethodAccepted, run, setBeanInstance, toClass
-
-
-
-
Field Detail
-
PROXY_SUFFIX
public static final String PROXY_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DecoratorProxyFactory
public DecoratorProxyFactory(String contextId, Class<T> proxyType, WeldInjectionPointAttributes<?,?> delegateInjectionPoint, jakarta.enterprise.inject.spi.Bean<?> bean)
-
-
Method Detail
-
addAdditionalInterfaces
protected void addAdditionalInterfaces(Set<Class<?>> interfaces)
Description copied from class:ProxyFactory
Sub classes may override to specify additional interfaces the proxy should implement- Overrides:
addAdditionalInterfaces
in classProxyFactory<T>
-
addMethodsFromClass
protected void addMethodsFromClass(org.jboss.classfilewriter.ClassFile proxyClassType, org.jboss.classfilewriter.ClassMethod staticConstructor)
- Overrides:
addMethodsFromClass
in classProxyFactory<T>
-
getProxyNameSuffix
protected String getProxyNameSuffix()
Description copied from class:ProxyFactory
Returns a suffix to append to the name of the proxy class. The name already consists of_$$_Weld, to which the suffix is added. This allows the creation of different types of proxies for the same class. - Overrides:
getProxyNameSuffix
in classProxyFactory<T>
- Returns:
- a name suffix
-
isUsingProxyInstantiator
protected boolean isUsingProxyInstantiator()
- Overrides:
isUsingProxyInstantiator
in classProxyFactory<T>
- Returns:
true
ifProxyInstantiator
is used to instantiate proxy instances
-
-