public abstract class AbstractOwbBean<T> extends Object implements OwbBean<T>
OwbBean contract.Bean| Modifier and Type | Field and Description |
|---|---|
protected Set<Type> |
apiTypes
Api types of the bean
|
protected boolean |
enabled
This bean is enabled or disabled
|
protected Set<Annotation> |
implQualifiers
Qualifiers of the bean
|
protected Set<javax.enterprise.inject.spi.InjectionPoint> |
injectionPoints
Beans injection points
|
protected Logger |
logger
Logger instance
|
protected String |
name
Name of the bean
|
protected boolean |
nullable
The bean allows nullable object
|
protected String |
passivatingId
This string will be used for passivating the Bean.
|
protected Class<T> |
returnType
Return type of the bean
|
protected Class<? extends Annotation> |
scopeClass
Cached scope type of the bean
|
protected boolean |
serializable
The bean is serializable or not
|
protected boolean |
specializedBean
This bean is specialized or not
|
protected Set<Class<? extends Annotation>> |
stereoTypeClasses
this is only for public access and will be built from
stereoTypes on demand |
protected Set<Annotation> |
stereoTypes
Stereotypes of the bean
|
protected WebBeansContext |
webBeansContext |
protected WebBeansType |
webBeansType
Web Beans type
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOwbBean(WebBeansType webBeansType,
Class<T> returnType,
WebBeansContext webBeansContext)
Constructor definiton.
|
protected |
AbstractOwbBean(WebBeansType webBeanType,
WebBeansContext webBeansContext)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addApiType(Class<?> apiType)
Add new api type.
|
void |
addInjectionPoint(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
Adds new injection point.
|
void |
addQualifier(Annotation qualifier)
Add new qualifier.
|
void |
addStereoType(Annotation stereoType)
Add new stereotype.
|
T |
create(javax.enterprise.context.spi.CreationalContext<T> creationalContext) |
protected abstract T |
createInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates the instance of the bean that has a specific implementation
type.
|
T |
createNewInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Create an instance.
|
void |
destroy(T instance,
javax.enterprise.context.spi.CreationalContext<T> creationalContext) |
void |
destroyCreatedInstance(T instance,
javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroys instance.
|
protected void |
destroyInstance(T instance,
javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroy the instance of the bean.
|
boolean |
equals(Object obj) |
Class<?> |
getBeanClass()
Get return types of the bean.
|
String |
getId()
get the unique Id of the bean.
|
List<javax.enterprise.inject.spi.InjectionPoint> |
getInjectionPoint(Member member)
Gets injection points for given member.
|
Set<javax.enterprise.inject.spi.InjectionPoint> |
getInjectionPoints() |
protected Logger |
getLogger()
The Logger should really only be used to log errors!
|
protected BeanManagerImpl |
getManager()
Gets manager instance
|
String |
getName()
Name of the bean.
|
Set<Annotation> |
getOwbStereotypes()
Gets the stereotypes.
|
Set<Annotation> |
getQualifiers() |
Class<T> |
getReturnType()
Gets type of the producer method/field or the bean class if it's not a producer.
|
Class<? extends Annotation> |
getScope() |
Set<Class<? extends Annotation>> |
getStereotypes() |
Set<Type> |
getTypes() |
WebBeansContext |
getWebBeansContext()
Get the web beans context this bean is associated with
|
WebBeansType |
getWebBeansType()
Get web bean type of the bean.
|
int |
hashCode() |
boolean |
isAlternative() |
boolean |
isDependent()
This determines if this bean is really a dependent bean,
and as such always creats a freshl instance for each
InjectionPoint.
|
boolean |
isEnabled()
Bean is enabled or not.
|
boolean |
isNullable() |
boolean |
isPassivationCapable()
True if passivation capable false otherwise.
|
boolean |
isSerializable()
Returns true if bean is capable of
serializable, false otherwise.
|
boolean |
isSpecializedBean()
Returns true if bean is a specialized bean, false otherwise.
|
void |
setEnabled(boolean enabled)
Set enableed flag.
|
void |
setImplScopeType(Annotation scopeType)
Set scope type.
|
void |
setName(String name)
Set name.
|
void |
setNullable(boolean nullable)
Set nullable flag.
|
void |
setSerializable(boolean serializable)
Sets serializable flag.
|
void |
setSpecializedBean(boolean specialized)
Set specialized flag.
|
String |
toString() |
void |
validatePassivationDependencies()
If bean is passivation capable, it validate all of its dependencies.
|
protected Logger logger
protected String name
protected Class<? extends Annotation> scopeClass
protected Set<Annotation> implQualifiers
protected WebBeansType webBeansType
protected Set<Annotation> stereoTypes
protected Set<Class<? extends Annotation>> stereoTypeClasses
stereoTypes on demandprotected boolean specializedBean
protected boolean enabled
protected boolean serializable
protected boolean nullable
protected Set<javax.enterprise.inject.spi.InjectionPoint> injectionPoints
protected String passivatingId
getId()protected final WebBeansContext webBeansContext
protected AbstractOwbBean(WebBeansType webBeansType, Class<T> returnType, WebBeansContext webBeansContext)
returnType - of the beanwebBeansContext - webBeansType - web beans typeprotected AbstractOwbBean(WebBeansType webBeanType, WebBeansContext webBeansContext)
webBeanType - beans typewebBeansContext - public WebBeansContext getWebBeansContext()
getWebBeansContext in interface OwbBean<T>protected BeanManagerImpl getManager()
public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
create in interface javax.enterprise.context.spi.Contextual<T>protected abstract T createInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
creationalContext - the contextual instance shall be created inpublic T createNewInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
createNewInstance in interface OwbBean<T>creationalContext - creaitonal contextpublic void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
destroy in interface javax.enterprise.context.spi.Contextual<T>protected void destroyInstance(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
instance - instance of the bean that is being destroyedcreationalContext - the contextual instance has been created inpublic void destroyCreatedInstance(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
destroyCreatedInstance in interface OwbBean<T>instance - instancecreationalContext - creationalpublic String getId()
public boolean isPassivationCapable()
OwbBeanisPassivationCapable in interface OwbBean<T>public Class<?> getBeanClass()
getBeanClass in interface javax.enterprise.inject.spi.Bean<T>public void setImplScopeType(Annotation scopeType)
setImplScopeType in interface OwbBean<T>scopeType - scope typepublic String getName()
getName in interface javax.enterprise.inject.spi.Bean<T>public WebBeansType getWebBeansType()
getWebBeansType in interface OwbBean<T>WebBeansTypepublic void addStereoType(Annotation stereoType)
addStereoType in interface OwbBean<T>stereoType - new stereotype annotationpublic void addApiType(Class<?> apiType)
addApiType in interface OwbBean<T>apiType - new api typepublic Set<Annotation> getOwbStereotypes()
getOwbStereotypes in interface OwbBean<T>public void addQualifier(Annotation qualifier)
addQualifier in interface OwbBean<T>qualifier - new qualifierpublic void setName(String name)
public Set<Annotation> getQualifiers()
getQualifiers in interface javax.enterprise.inject.spi.Bean<T>public Class<? extends Annotation> getScope()
getScope in interface javax.enterprise.inject.spi.Bean<T>public Set<Type> getTypes()
getTypes in interface javax.enterprise.inject.spi.Bean<T>public Class<T> getReturnType()
getReturnType in interface OwbBean<T>getBeanClass()public void setNullable(boolean nullable)
setNullable in interface OwbBean<T>nullable - flagpublic void setSerializable(boolean serializable)
setSerializable in interface OwbBean<T>serializable - flagpublic boolean isNullable()
isNullable in interface javax.enterprise.inject.spi.Bean<T>public boolean isSerializable()
isSerializable in interface OwbBean<T>public void addInjectionPoint(javax.enterprise.inject.spi.InjectionPoint injectionPoint)
addInjectionPoint in interface OwbBean<T>injectionPoint - injection pointpublic Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
getInjectionPoints in interface javax.enterprise.inject.spi.Bean<T>public void setSpecializedBean(boolean specialized)
setSpecializedBean in interface OwbBean<T>specialized - flagpublic void setEnabled(boolean enabled)
setEnabled in interface OwbBean<T>enabled - flagpublic boolean isSpecializedBean()
isSpecializedBean in interface OwbBean<T>public List<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoint(Member member)
For example, if member is field, it gets all injected field's injection points of bean.
getInjectionPoint in interface OwbBean<T>member - java memberpublic Set<Class<? extends Annotation>> getStereotypes()
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>public boolean isAlternative()
isAlternative in interface javax.enterprise.inject.spi.Bean<T>public boolean isEnabled()
protected Logger getLogger()
public boolean isDependent()
OwbBeanisDependent in interface OwbBean<T>true if this is a dependent beanpublic void validatePassivationDependencies()
OwbBeanvalidatePassivationDependencies in interface OwbBean<T>Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.