Class AbstractInitializableBeanDefinitionReference<T>

java.lang.Object
io.micronaut.context.AbstractInitializableBeanDefinitionReference<T>
Type Parameters:
T - The bean type
All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.beans.BeanInfo<T>, io.micronaut.core.order.Ordered, io.micronaut.core.type.ArgumentCoercible<T>, BeanContextConditional, BeanDefinitionReference<T>, BeanType<T>, QualifiedBeanType<T>

@Internal public abstract class AbstractInitializableBeanDefinitionReference<T> extends Object implements BeanDefinitionReference<T>
An uninitialized and unloaded component definition with basic information available regarding its requirements.
Since:
3.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER

    Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

    EMPTY

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing)
     
    protected
    AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing, boolean isProxiedBean, boolean isProxyTarget)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    io.micronaut.core.annotation.AnnotationMetadata
     
     
    protected abstract Class<? extends BeanDefinition<?>>
    Implementors should provide an implementation of this method that returns the bean definition type.
    final @NonNull Set<Class<?>>
    Returns a potentially limited subset of bean types exposed by this bean.
     
    int
     
    boolean
     
    boolean
    Checks whether the bean type is a container type.
    boolean
     
    boolean
    Return whether this component is enabled for the given context.
    boolean
    isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
    Return whether this component is enabled for the given context.
    boolean
     
    boolean
     
    boolean
    Returns whether another bean exists that proxies this bean.
    boolean
     
    boolean
     
    load(BeanContext context)
    Loads the bean definition for the current BeanContext.
    protected final void
    onFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext)
     
    boolean
    By default, when the BeanContext is started, the BeanDefinition.getExecutableMethods() are not processed by registered ExecutableMethodProcessor instances unless this method returns true.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata

    enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent

    Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate

    booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.inject.BeanDefinitionReference

    load

    Methods inherited from interface io.micronaut.core.beans.BeanInfo

    asArgument, getGenericBeanType, getOrder

    Methods inherited from interface io.micronaut.inject.BeanType

    getBeanName, getBeanType, isCandidateBean

    Methods inherited from interface io.micronaut.inject.QualifiedBeanType

    getDeclaredQualifier, resolveDynamicQualifier
  • Constructor Details

    • AbstractInitializableBeanDefinitionReference

      public AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing)
      Parameters:
      beanTypeName - The bean type name
      beanDefinitionTypeName - The bean definition type name
      annotationMetadata - The annotationMetadata
      isPrimary - Is primary bean?
      isContextScope - Is context scope?
      isConditional - Is conditional? = No @Requires
      isContainerType - Is container type?
      isSingleton - Is singleton?
      isConfigurationProperties - Is configuration properties?
      hasExposedTypes - Has exposed types?
      requiresMethodProcessing - Is requires method processing?
    • AbstractInitializableBeanDefinitionReference

      protected AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing, boolean isProxiedBean, boolean isProxyTarget)
      Parameters:
      beanTypeName - The bean type name
      beanDefinitionTypeName - The bean definition type name
      annotationMetadata - The annotationMetadata
      isPrimary - Is primary bean?
      isContextScope - Is context scope?
      isConditional - Is conditional? = No @Requires
      isContainerType - Is container type?
      isSingleton - Is singleton?
      isConfigurationProperties - Is configuration properties?
      hasExposedTypes - Has exposed types?
      requiresMethodProcessing - Is requires method processing?
      isProxiedBean - Is the bean proxied
      isProxyTarget - Is the bean a retained proxy target
  • Method Details

    • isProxyTarget

      public boolean isProxyTarget()
      Specified by:
      isProxyTarget in interface BeanDefinitionReference<T>
      Returns:
      Whether this reference is a proxy target.
    • isProxiedBean

      public boolean isProxiedBean()
      Description copied from interface: BeanDefinitionReference
      Returns whether another bean exists that proxies this bean. In other words this bean is the target of a proxy.
      Specified by:
      isProxiedBean in interface BeanDefinitionReference<T>
      Returns:
      Is the reference a proxy target.
    • getName

      public String getName()
      Specified by:
      getName in interface BeanType<T>
      Returns:
      The class name
    • getBeanDefinitionName

      public String getBeanDefinitionName()
      Specified by:
      getBeanDefinitionName in interface BeanDefinitionReference<T>
      Returns:
      The class name of the backing BeanDefinition
    • getAnnotationMetadata

      public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
      Specified by:
      getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • isPrimary

      public boolean isPrimary()
      Specified by:
      isPrimary in interface BeanType<T>
      Returns:
      Whether the bean definition is the Primary
    • isSingleton

      public boolean isSingleton()
      Specified by:
      isSingleton in interface BeanDefinitionReference<T>
      Returns:
      Is this bean a singleton.
    • isConfigurationProperties

      public boolean isConfigurationProperties()
      Specified by:
      isConfigurationProperties in interface BeanDefinitionReference<T>
      Returns:
      Is this bean a configuration properties.
    • isContainerType

      public boolean isContainerType()
      Description copied from interface: BeanType
      Checks whether the bean type is a container type.
      Specified by:
      isContainerType in interface BeanType<T>
      Returns:
      Whether the type is a container type like Iterable.
    • isContextScope

      public boolean isContextScope()
      Specified by:
      isContextScope in interface BeanDefinitionReference<T>
      Returns:
      Is this class context scope
    • requiresMethodProcessing

      public boolean requiresMethodProcessing()
      Description copied from interface: BeanType
      By default, when the BeanContext is started, the BeanDefinition.getExecutableMethods() are not processed by registered ExecutableMethodProcessor instances unless this method returns true.
      Specified by:
      requiresMethodProcessing in interface BeanType<T>
      Returns:
      Whether the bean definition requires method processing
      See Also:
    • getExposedTypes

      @NonNull public final @NonNull Set<Class<?>> getExposedTypes()
      Description copied from interface: BeanType
      Returns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by the Type annotation.
      Specified by:
      getExposedTypes in interface BeanType<T>
      Returns:
      The exposed types
    • load

      public BeanDefinition load(BeanContext context)
      Description copied from interface: BeanDefinitionReference
      Loads the bean definition for the current BeanContext.
      Specified by:
      load in interface BeanDefinitionReference<T>
      Parameters:
      context - The bean context
      Returns:
      The loaded bean definition or null if it shouldn't be loaded
    • isPresent

      public boolean isPresent()
      Specified by:
      isPresent in interface BeanDefinitionReference<T>
      Returns:
      Is the underlying bean type present on the classpath
    • isEnabled

      public boolean isEnabled(BeanContext context)
      Description copied from interface: BeanContextConditional
      Return whether this component is enabled for the given context.
      Specified by:
      isEnabled in interface BeanContextConditional
      Parameters:
      context - The context
      Returns:
      True if it is
    • isEnabled

      public boolean isEnabled(BeanContext context, BeanResolutionContext resolutionContext)
      Description copied from interface: BeanContextConditional
      Return whether this component is enabled for the given context.
      Specified by:
      isEnabled in interface BeanContextConditional
      Parameters:
      context - The context
      resolutionContext - The bean resolution context
      Returns:
      True if it is
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getBeanDefinitionType

      protected abstract Class<? extends BeanDefinition<?>> getBeanDefinitionType()
      Implementors should provide an implementation of this method that returns the bean definition type.
      Returns:
      The bean definition type.
    • onFail

      protected final void onFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext)