Class ProducerMethodBean<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, OwbBean<T>

    public class ProducerMethodBean<T>
    extends AbstractProducerBean<T>
    Concrete implementation of the AbstractOwbBean.

    It is defined as producer method component.

    Version:
    $Rev$ $Date$
    • Field Detail

      • creatorMethod

        protected Method creatorMethod
        Creator method of the parent component
    • Constructor Detail

      • ProducerMethodBean

        public ProducerMethodBean​(InjectionTargetBean<P> ownerComponent,
                                  jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes,
                                  Class<T> returnType,
                                  MethodProducerFactory<P> producerFactory)
        Creates a new instance.
        Parameters:
        ownerComponent - parent bean
        returnType - producer method return type
    • Method Detail

      • getCreatorMethod

        public Method getCreatorMethod()
        Gets the creator method.
        Returns:
        producer method
      • setCreatorMethod

        public void setCreatorMethod​(Method creatorMethod)
        Sets the method.
        Parameters:
        creatorMethod - producer method
      • getId

        public String getId()
        Description copied from class: AbstractOwbBean
        get the unique Id of the bean. This will get used as reference on passivation. Gets id of the bean.
        Specified by:
        getId in interface OwbBean<T>
        Specified by:
        getId in interface jakarta.enterprise.inject.spi.PassivationCapable
        Overrides:
        getId in class AbstractOwbBean<T>
        Returns:
        id of the bean
      • create

        public T create​(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
        Description copied from class: AbstractOwbBean
        Specified by:
        create in interface jakarta.enterprise.context.spi.Contextual<T>
        Overrides:
        create in class AbstractOwbBean<T>