Class AbstractProducerBean<T>

Type Parameters:
T - bean type info
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>
Direct Known Subclasses:
ProducerFieldBean, ProducerMethodBean

public class AbstractProducerBean<T> extends AbstractOwbBean<T>
Abstract class for producer components.
Version:
$Rev$ $Date$
  • Constructor Details

    • AbstractProducerBean

      public AbstractProducerBean(InjectionTargetBean<?> ownerComponent, WebBeansType webBeansType, jakarta.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> returnType, jakarta.enterprise.inject.spi.ProducerFactory<?> producerFactory)
      Create a new instance.
      Parameters:
      returnType - bean type info
  • Method Details

    • getProducer

      public jakarta.enterprise.inject.spi.Producer<T> getProducer()
      Returns:
      the producer for this bean;
    • getReturnType

      public Class<T> getReturnType()
      Description copied from class: AbstractOwbBean
      Gets type of the producer method/field or the bean class if it's not a producer. This basically determines the class which will get created.
      Specified by:
      getReturnType in interface OwbBean<T>
      Overrides:
      getReturnType in class AbstractOwbBean<T>
      Returns:
      type of the producer method
      See Also:
    • getOwnerComponent

      public InjectionTargetBean<?> getOwnerComponent()
    • providedId

      protected String providedId()
      Overrides:
      providedId in class AbstractOwbBean<T>
    • checkNullInstance

      protected void checkNullInstance(Object instance, String producerName)
      Check null control.
      Parameters:
      instance - bean instance
    • checkScopeType

      protected void checkScopeType(String producerName, Object instance)
      Check passivation check.
    • isPassivationCapable

      protected boolean isPassivationCapable(Class<?> returnType, Integer modifiers)