Package org.infinispan.cdi.common.util
Class ForwardingBean<T>
- java.lang.Object
-
- org.infinispan.cdi.common.util.ForwardingBean<T>
-
- Type Parameters:
T- the class of the bean
- All Implemented Interfaces:
Contextual<T>,Bean<T>,BeanAttributes<T>
public abstract class ForwardingBean<T> extends Object implements Bean<T>
An implementation ofBeanthat forwards all calls to thedelegate().- Author:
- Pete Muir
-
-
Constructor Summary
Constructors Constructor Description ForwardingBean()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tcreate(CreationalContext<T> creationalContext)Create a new instance of the contextual type.protected abstract Bean<T>delegate()All calls to thisBeaninstance are forwarded to the delegate unless overridden.voiddestroy(T instance, CreationalContext<T> creationalContext)Destroy an instance of the contextual type.booleanequals(Object obj)Class<?>getBeanClass()The bean class of the managed bean or session bean or of the bean that declares the producer method or field.Set<InjectionPoint>getInjectionPoints()Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.StringgetName()Obtains the EL name of a bean, if it has one.Set<Annotation>getQualifiers()Obtains the qualifiers of the bean.Class<? extends Annotation>getScope()Obtains the scope of the bean.Set<Class<? extends Annotation>>getStereotypes()Obtains the stereotypes of the bean.Set<Type>getTypes()Obtains the bean types of the bean.inthashCode()booleanisAlternative()Determines if the bean is an alternative.booleanisNullable()StringtoString()
-
-
-
Method Detail
-
delegate
protected abstract Bean<T> delegate()
All calls to thisBeaninstance are forwarded to the delegate unless overridden.- Returns:
- the delegate
Bean
-
getBeanClass
public Class<?> getBeanClass()
Description copied from interface:BeanThe bean class of the managed bean or session bean or of the bean that declares the producer method or field.- Specified by:
getBeanClassin interfaceBean<T>- Returns:
- the bean class
-
getInjectionPoints
public Set<InjectionPoint> getInjectionPoints()
Description copied from interface:BeanObtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.- Specified by:
getInjectionPointsin interfaceBean<T>- Returns:
- the set of injection points of the bean
-
getName
public String getName()
Description copied from interface:BeanAttributesObtains the EL name of a bean, if it has one.- Specified by:
getNamein interfaceBeanAttributes<T>- Returns:
- the EL name
-
getQualifiers
public Set<Annotation> getQualifiers()
Description copied from interface:BeanAttributesObtains the qualifiers of the bean.- Specified by:
getQualifiersin interfaceBeanAttributes<T>- Returns:
- the qualifiers
-
getScope
public Class<? extends Annotation> getScope()
Description copied from interface:BeanAttributesObtains the scope of the bean.- Specified by:
getScopein interfaceBeanAttributes<T>- Returns:
- the scope
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
Description copied from interface:BeanAttributesObtains the stereotypes of the bean.- Specified by:
getStereotypesin interfaceBeanAttributes<T>- Returns:
- the set of stereotypes
-
getTypes
public Set<Type> getTypes()
Description copied from interface:BeanAttributesObtains the bean types of the bean.- Specified by:
getTypesin interfaceBeanAttributes<T>- Returns:
- the bean types
-
isAlternative
public boolean isAlternative()
Description copied from interface:BeanAttributesDetermines if the bean is an alternative. A custom implementation ofBeanmay implementPrioritizedin order to be selected for the application.Prioritized.getPriority()determines the priority used to resolve ambiguities.- Specified by:
isAlternativein interfaceBeanAttributes<T>- Returns:
trueif the bean is an alternative, andfalseotherwise.
-
isNullable
public boolean isNullable()
-
create
public T create(CreationalContext<T> creationalContext)
Description copied from interface:ContextualCreate a new instance of the contextual type. Instances should use the givenCreationalContextwhen obtaining contextual references to inject, in order to ensure that any dependent objects are associated with the contextual instance that is being created. An implementation may callCreationalContext.push(Object)between instantiation and injection to help the container minimize the use of client proxy objects.- Specified by:
createin interfaceContextual<T>- Parameters:
creationalContext- the context in which this instance is being created- Returns:
- the contextual instance
-
destroy
public void destroy(T instance, CreationalContext<T> creationalContext)
Description copied from interface:ContextualDestroy an instance of the contextual type. Implementations should callCreationalContext.release()to allow the container to destroy dependent objects of the contextual instance.- Specified by:
destroyin interfaceContextual<T>- Parameters:
instance- the contextual instance to destroycreationalContext- the context in which this instance was created
-
-