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

java.lang.Object
  extended by org.apache.webbeans.container.SerializableBean<T>
All Implemented Interfaces:
Serializable, Contextual<T>, Bean<T>, PassivationCapable

public final class SerializableBean<T>
extends Object
implements Bean<T>, 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: 952905 $ $Date: 2010-06-09 07:10:59 +0200 (Mi, 09 Jun 2010) $
See Also:
Serialized Form

Method Summary
 T create(CreationalContext<T> tCreationalContext)
           
 void destroy(T instance, CreationalContext<T> tCreationalContext)
           
 boolean equals(Object other)
          If the other object is a SerializableBean too, we compare the 2 underlying wrapped beans.
 Bean<T> getBean()
           
 Class<?> getBeanClass()
           
 String getId()
           
 Set<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 Bean<T> getBean()
Returns:
the delegated internal Bean.

getTypes

public Set<Type> getTypes()
Specified by:
getTypes in interface Bean<T>

getQualifiers

public Set<Annotation> getQualifiers()
Specified by:
getQualifiers in interface Bean<T>

getScope

public Class<? extends Annotation> getScope()
Specified by:
getScope in interface Bean<T>

getName

public String getName()
Specified by:
getName in interface Bean<T>

isNullable

public boolean isNullable()
Specified by:
isNullable in interface Bean<T>

getInjectionPoints

public Set<InjectionPoint> getInjectionPoints()
Specified by:
getInjectionPoints in interface Bean<T>

getBeanClass

public Class<?> getBeanClass()
Specified by:
getBeanClass in interface Bean<T>

getStereotypes

public Set<Class<? extends Annotation>> getStereotypes()
Specified by:
getStereotypes in interface Bean<T>

isAlternative

public boolean isAlternative()
Specified by:
isAlternative in interface Bean<T>

create

public T create(CreationalContext<T> tCreationalContext)
Specified by:
create in interface Contextual<T>

destroy

public void destroy(T instance,
                    CreationalContext<T> tCreationalContext)
Specified by:
destroy in interface Contextual<T>

getId

public String getId()
Specified by:
getId in interface 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-2010 The Apache Software Foundation. All Rights Reserved.