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

java.lang.Object
  extended by org.apache.webbeans.container.SerializableBean<T>
All Implemented Interfaces:
java.io.Serializable, javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable

public final class SerializableBean<T>
extends java.lang.Object
implements javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable, java.io.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: 1063529 $ $Date: 2011-01-26 00:53:04 +0100 (Mi, 26 Jan 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(java.lang.Object other)
          If the other object is a SerializableBean too, we compare the 2 underlying wrapped beans.
 javax.enterprise.inject.spi.Bean<T> getBean()
           
 java.lang.Class<?> getBeanClass()
           
 java.lang.String getId()
           
 java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
           
 java.lang.String getName()
           
 java.util.Set<java.lang.annotation.Annotation> getQualifiers()
           
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
           
 java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getStereotypes()
           
 java.util.Set<java.lang.reflect.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 java.util.Set<java.lang.reflect.Type> getTypes()
Specified by:
getTypes in interface javax.enterprise.inject.spi.Bean<T>

getQualifiers

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

getScope

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

getName

public java.lang.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 java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
Specified by:
getInjectionPoints in interface javax.enterprise.inject.spi.Bean<T>

getBeanClass

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

getStereotypes

public java.util.Set<java.lang.Class<? extends java.lang.annotation.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 java.lang.String getId()
Specified by:
getId in interface javax.enterprise.inject.spi.PassivationCapable

equals

public boolean equals(java.lang.Object other)
If the other object is a SerializableBean too, we compare the 2 underlying wrapped beans.

Overrides:
equals in class java.lang.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 java.lang.Object
Returns:
hashCode of the underlying bean instance.


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