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 Details

    • creatorMethod

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

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

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

      public boolean isPassivationCapable()
      Description copied from interface: OwbBean
      True if passivation capable false otherwise.
      Specified by:
      isPassivationCapable in interface OwbBean<T>
      Overrides:
      isPassivationCapable in class AbstractOwbBean<T>
      Returns:
      true if this bean is passivation capable
    • addToStringInfo

      protected void addToStringInfo(StringBuilder builder)
      For producer beans we add the info about the owner component
      Overrides:
      addToStringInfo in class AbstractOwbBean<T>