Package org.apache.webbeans.container
Class SerializableBean<T>
- java.lang.Object
-
- org.apache.webbeans.container.SerializableBean<T>
-
- All Implemented Interfaces:
Serializable,javax.enterprise.context.spi.Contextual<T>,javax.enterprise.inject.spi.Bean<T>,javax.enterprise.inject.spi.BeanAttributes<T>,javax.enterprise.inject.spi.PassivationCapable
public final class SerializableBean<T> extends Object implements javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable, Serializable
Wrapper to make all our Beans serializable. This is basically a delegate to an underlying Bean<T>. We use thePassivationCapable.getId()andBeanManager.getPassivationCapableBean(String)for serialisation and deserialisation.- Version:
- $Rev$ $Date$
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)voiddestroy(T instance, javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)booleanequals(Object other)If the other object is a SerializableBean too, we compare the 2 underlying wrapped beans.javax.enterprise.inject.spi.Bean<T>getBean()Class<?>getBeanClass()StringgetId()Set<javax.enterprise.inject.spi.InjectionPoint>getInjectionPoints()StringgetName()Set<Annotation>getQualifiers()Class<? extends Annotation>getScope()Set<Class<? extends Annotation>>getStereotypes()Set<Type>getTypes()inthashCode()We need to return the hashCode of the wrapped underlying bean, otherwise the context won't work.booleanisAlternative()booleanisNullable()
-
-
-
Method Detail
-
getBean
public javax.enterprise.inject.spi.Bean<T> getBean()
- Returns:
- the delegated internal Bean.
-
getTypes
public Set<Type> getTypes()
- Specified by:
getTypesin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getQualifiers
public Set<Annotation> getQualifiers()
- Specified by:
getQualifiersin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScopein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
getName
public String getName()
- Specified by:
getNamein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
isNullable
public boolean isNullable()
- Specified by:
isNullablein interfacejavax.enterprise.inject.spi.Bean<T>
-
getInjectionPoints
public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
- Specified by:
getInjectionPointsin interfacejavax.enterprise.inject.spi.Bean<T>
-
getBeanClass
public Class<?> getBeanClass()
- Specified by:
getBeanClassin interfacejavax.enterprise.inject.spi.Bean<T>
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
- Specified by:
getStereotypesin interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
isAlternative
public boolean isAlternative()
- Specified by:
isAlternativein interfacejavax.enterprise.inject.spi.BeanAttributes<T>
-
create
public T create(javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
- Specified by:
createin interfacejavax.enterprise.context.spi.Contextual<T>
-
destroy
public void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
- Specified by:
destroyin interfacejavax.enterprise.context.spi.Contextual<T>
-
getId
public String getId()
- Specified by:
getIdin interfacejavax.enterprise.inject.spi.PassivationCapable
-
equals
public boolean equals(Object other)
If the other object is a SerializableBean too, we compare the 2 underlying wrapped beans.
-
-