Package io.micronaut.context
Class AbstractInitializableBeanDefinitionReference<T>
java.lang.Object
io.micronaut.context.AbstractInitializableBeanDefinitionReference<T>
- Type Parameters:
T- The bean type
- All Implemented Interfaces:
AnnotationMetadata,AnnotationMetadataDelegate,AnnotationMetadataProvider,AnnotationSource,BeanInfo<T>,Ordered,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
- Author:
- Denis Stepanov
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing) protectedAbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, 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 TypeMethodDescriptionbooleanSupplies the metadata.protected abstract Class<? extends BeanDefinition<?>>Implementors should provide an implementation of this method that returns the bean definition type.Returns a potentially limited subset of bean types exposed by this bean.getName()inthashCode()booleanbooleanChecks whether the bean type is a container type.booleanbooleanisEnabled(BeanContext context) Return whether this component is enabled for the given context.booleanisEnabled(BeanContext context, BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.booleanbooleanbooleanReturns whether another bean exists that proxies this bean.booleanbooleanload(BeanContext context) Loads the bean definition for the currentBeanContext.protected final voidonFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext) booleanBy default, when theBeanContextis started, theBeanDefinition.getExecutableMethods()are not processed by registeredExecutableMethodProcessorinstances unless this method returns true.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods 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, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.inject.BeanDefinitionReference
loadMethods inherited from interface io.micronaut.core.beans.BeanInfo
asArgument, getGenericBeanType, getOrderMethods inherited from interface io.micronaut.inject.BeanType
getBeanName, getBeanType, isCandidateBeanMethods inherited from interface io.micronaut.inject.QualifiedBeanType
getDeclaredQualifier, resolveDynamicQualifier
-
Constructor Details
-
AbstractInitializableBeanDefinitionReference
public AbstractInitializableBeanDefinitionReference(String beanTypeName, String beanDefinitionTypeName, AnnotationMetadata annotationMetadata, boolean isPrimary, boolean isContextScope, boolean isConditional, boolean isContainerType, boolean isSingleton, boolean isConfigurationProperties, boolean hasExposedTypes, boolean requiresMethodProcessing) - Parameters:
beanTypeName- The bean type namebeanDefinitionTypeName- The bean definition type nameannotationMetadata- The annotationMetadataisPrimary- Is primary bean?isContextScope- Is context scope?isConditional- Is conditional? = No @RequiresisContainerType- 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, 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 namebeanDefinitionTypeName- The bean definition type nameannotationMetadata- The annotationMetadataisPrimary- Is primary bean?isContextScope- Is context scope?isConditional- Is conditional? = No @RequiresisContainerType- Is container type?isSingleton- Is singleton?isConfigurationProperties- Is configuration properties?hasExposedTypes- Has exposed types?requiresMethodProcessing- Is requires method processing?isProxiedBean- Is the bean proxiedisProxyTarget- Is the bean a retained proxy target
-
-
Method Details
-
isProxyTarget
public boolean isProxyTarget()- Specified by:
isProxyTargetin interfaceBeanDefinitionReference<T>- Returns:
- Whether this reference is a proxy target.
-
isProxiedBean
public boolean isProxiedBean()Description copied from interface:BeanDefinitionReferenceReturns whether another bean exists that proxies this bean. In other words this bean is the target of a proxy.- Specified by:
isProxiedBeanin interfaceBeanDefinitionReference<T>- Returns:
- Is the reference a proxy target.
-
getName
-
getBeanDefinitionName
- Specified by:
getBeanDefinitionNamein interfaceBeanDefinitionReference<T>- Returns:
- The class name of the backing
BeanDefinition
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Returns:
- The
AnnotationMetadata
-
isPrimary
public boolean isPrimary() -
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceBeanDefinitionReference<T>- Returns:
- Is this bean a singleton.
-
isConfigurationProperties
public boolean isConfigurationProperties()- Specified by:
isConfigurationPropertiesin interfaceBeanDefinitionReference<T>- Returns:
- Is this bean a configuration properties.
-
isContainerType
public boolean isContainerType()Description copied from interface:BeanTypeChecks whether the bean type is a container type.- Specified by:
isContainerTypein interfaceBeanType<T>- Returns:
- Whether the type is a container type like
Iterable.
-
isContextScope
public boolean isContextScope()- Specified by:
isContextScopein interfaceBeanDefinitionReference<T>- Returns:
- Is this class context scope
-
requiresMethodProcessing
public boolean requiresMethodProcessing()Description copied from interface:BeanTypeBy default, when theBeanContextis started, theBeanDefinition.getExecutableMethods()are not processed by registeredExecutableMethodProcessorinstances unless this method returns true.- Specified by:
requiresMethodProcessingin interfaceBeanType<T>- Returns:
- Whether the bean definition requires method processing
- See Also:
-
getExposedTypes
Description copied from interface:BeanTypeReturns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by theTypeannotation.- Specified by:
getExposedTypesin interfaceBeanType<T>- Returns:
- The exposed types
-
load
Description copied from interface:BeanDefinitionReferenceLoads the bean definition for the currentBeanContext.- Specified by:
loadin interfaceBeanDefinitionReference<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:
isPresentin interfaceBeanDefinitionReference<T>- Returns:
- Is the underlying bean type present on the classpath
-
isEnabled
Description copied from interface:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
context- The context- Returns:
- True if it is
-
isEnabled
Description copied from interface:BeanContextConditionalReturn whether this component is enabled for the given context.- Specified by:
isEnabledin interfaceBeanContextConditional- Parameters:
context- The contextresolutionContext- The bean resolution context- Returns:
- True if it is
-
equals
-
toString
-
hashCode
public int hashCode() -
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)
-