Class SerializableBean<T>

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

public final class SerializableBean<T> extends Object implements jakarta.enterprise.inject.spi.Bean<T>, jakarta.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$ $Date$
See Also:
  • Method Details

    • getBean

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

      public Set<Type> getTypes()
      Specified by:
      getTypes in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getQualifiers

      public Set<Annotation> getQualifiers()
      Specified by:
      getQualifiers in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getScope

      public Class<? extends Annotation> getScope()
      Specified by:
      getScope in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getName

      public String getName()
      Specified by:
      getName in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • getInjectionPoints

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

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

      public Set<Class<? extends Annotation>> getStereotypes()
      Specified by:
      getStereotypes in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • isAlternative

      public boolean isAlternative()
      Specified by:
      isAlternative in interface jakarta.enterprise.inject.spi.BeanAttributes<T>
    • create

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

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

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