org.apache.webbeans.container
Class SerializableBean<T>

java.lang.Object
  extended by 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.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 the PassivationCapable.getId() and BeanManager.getPassivationCapableBean(String) for serialisation and deserialisation.

Version:
$Rev: 1182847 $ $Date: 2011-10-13 15:31:37 +0200 (Do, 13 Okt 2011) $
See Also:
Serialized Form

Method Summary
 T create(javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
           
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
           
 boolean equals(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()
           
 String getId()
           
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 String getName()
           
 Set<Annotation> getQualifiers()
           
 Class<? extends Annotation> getScope()
           
 Set<Class<? extends Annotation>> getStereotypes()
           
 Set<Type> getTypes()
           
 int hashCode()
          We need to return the hashCode of the wrapped underlying bean, otherwise the context won't work.
 boolean isAlternative()
           
 boolean isNullable()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBean

public javax.enterprise.inject.spi.Bean<T> getBean()
Returns:
the delegated internal Bean.

getTypes

public Set<Type> getTypes()
Specified by:
getTypes in interface javax.enterprise.inject.spi.Bean<T>

getQualifiers

public Set<Annotation> getQualifiers()
Specified by:
getQualifiers in interface javax.enterprise.inject.spi.Bean<T>

getScope

public Class<? extends Annotation> getScope()
Specified by:
getScope in interface javax.enterprise.inject.spi.Bean<T>

getName

public String getName()
Specified by:
getName in interface javax.enterprise.inject.spi.Bean<T>

isNullable

public boolean isNullable()
Specified by:
isNullable in interface javax.enterprise.inject.spi.Bean<T>

getInjectionPoints

public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
Specified by:
getInjectionPoints in interface javax.enterprise.inject.spi.Bean<T>

getBeanClass

public Class<?> getBeanClass()
Specified by:
getBeanClass in interface javax.enterprise.inject.spi.Bean<T>

getStereotypes

public Set<Class<? extends Annotation>> getStereotypes()
Specified by:
getStereotypes in interface javax.enterprise.inject.spi.Bean<T>

isAlternative

public boolean isAlternative()
Specified by:
isAlternative in interface javax.enterprise.inject.spi.Bean<T>

create

public T create(javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
Specified by:
create in interface javax.enterprise.context.spi.Contextual<T>

destroy

public void destroy(T instance,
                    javax.enterprise.context.spi.CreationalContext<T> tCreationalContext)
Specified by:
destroy in interface javax.enterprise.context.spi.Contextual<T>

getId

public String getId()
Specified by:
getId in interface javax.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.

Overrides:
equals in class Object

hashCode

public int hashCode()
We need to return the hashCode of the wrapped underlying bean, otherwise the context won't work.

Overrides:
hashCode in class Object
Returns:
hashCode of the underlying bean instance.


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.