Class ManagedBean<T>

Type Parameters:
T - The type (class) of the bean
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, ClassBean<T>, DecorableBean<T>, WeldBean<T>
Direct Known Subclasses:
DecoratorImpl, InterceptorImpl

public class ManagedBean<T> extends AbstractClassBean<T>
Represents a simple bean
Author:
Pete Muir, Marius Bogoevici, Ales Justin, Marko Luksa, Laird Nelson
  • Constructor Details

    • ManagedBean

      protected ManagedBean(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, org.jboss.weld.serialization.spi.BeanIdentifier identifier, BeanManagerImpl beanManager)
      Constructor
      Parameters:
      type - The type of the bean
      beanManager - The Bean manager
  • Method Details

    • of

      public static <T> ManagedBean<T> of(jakarta.enterprise.inject.spi.BeanAttributes<T> attributes, EnhancedAnnotatedType<T> clazz, BeanManagerImpl beanManager)
      Creates a simple, annotation defined Web Bean
      Type Parameters:
      T - The type
      Parameters:
      clazz - The class
      beanManager - the current manager
      Returns:
      A Web Bean
    • internalInitialize

      public void internalInitialize(BeanDeployerEnvironment environment)
      Description copied from class: AbstractClassBean
      Initializes the bean and its metadata
      Overrides:
      internalInitialize in class AbstractClassBean<T>
    • initializeAfterBeanDiscovery

      public void initializeAfterBeanDiscovery()
      Description copied from class: RIBean
      In particular cases, the deployer must perform some initialization operations only after all beans have been deployed (e.g. for initializing decorators taking into account the possibility of having custom decorators which are deployed through portable extensions)
      Overrides:
      initializeAfterBeanDiscovery in class AbstractBean<T,Class<T>>
    • create

      public T create(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
      Creates an instance of the bean
      Returns:
      The instance
    • destroy

      public void destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
      Destroys an instance of the bean
      Specified by:
      destroy in interface jakarta.enterprise.context.spi.Contextual<T>
      Overrides:
      destroy in class RIBean<T>
      Parameters:
      instance - The instance
    • checkType

      protected void checkType()
      Validates the type
      Specified by:
      checkType in class AbstractBean<T,Class<T>>
    • checkBeanImplementation

      protected void checkBeanImplementation()
      Description copied from class: AbstractClassBean
      Validates the bean implementation
      Overrides:
      checkBeanImplementation in class AbstractClassBean<T>
    • specialize

      protected void specialize()
      Overrides:
      specialize in class AbstractBean<T,Class<T>>
    • isInterceptionCandidate

      protected boolean isInterceptionCandidate()
      Specified by:
      isInterceptionCandidate in class AbstractClassBean<T>
    • toString

      public String toString()
      Overrides:
      toString in class CommonBean<T>
    • isProxyable

      public boolean isProxyable()
      Specified by:
      isProxyable in class RIBean<T>
    • isPassivationCapableBean

      public boolean isPassivationCapableBean()
      Specified by:
      isPassivationCapableBean in class RIBean<T>
    • isPassivationCapableDependency

      public boolean isPassivationCapableDependency()
      Specified by:
      isPassivationCapableDependency in class RIBean<T>
    • setProducer

      public void setProducer(jakarta.enterprise.inject.spi.InjectionTarget<T> producer)
      Overrides:
      setProducer in class AbstractClassBean<T>