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, NewManagedBean

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

      • 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 Detail

      • 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
      • 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
      • isProxyable

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

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