Package io.micronaut.context
Class AbstractInitializableBeanDefinitionAndReference<T>
java.lang.Object
io.micronaut.context.AbstractInitializableBeanDefinition<T>
io.micronaut.context.AbstractInitializableBeanDefinitionAndReference<T>
- Type Parameters:
T- The bean type
- All Implemented Interfaces:
BeanContextConfigurable,EnvironmentConfigurable,AnnotationMetadata,AnnotationMetadataDelegate,AnnotationMetadataProvider,AnnotationSource,BeanInfo<T>,Named,Ordered,ArgumentCoercible<T>,BeanContextConditional,BeanDefinition<T>,BeanDefinitionReference<T>,BeanType<T>,InjectableBeanDefinition<T>,InstantiatableBeanDefinition<T>,QualifiedBeanType<T>
public abstract class AbstractInitializableBeanDefinitionAndReference<T>
extends AbstractInitializableBeanDefinition<T>
implements BeanDefinitionReference<T>
A variation of
AbstractInitializableBeanDefinition that is also a BeanDefinitionReference.- Since:
- 4.4.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.context.AbstractInitializableBeanDefinition
AbstractInitializableBeanDefinition.AnnotationReference, AbstractInitializableBeanDefinition.FieldReference, AbstractInitializableBeanDefinition.MethodOrFieldReference, AbstractInitializableBeanDefinition.MethodReference, AbstractInitializableBeanDefinition.PrecalculatedInfo -
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
ConstructorsModifierConstructorDescriptionprotectedAbstractInitializableBeanDefinitionAndReference(Class<T> beanType, @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable AnnotationMetadata annotationMetadata, @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo) protectedAbstractInitializableBeanDefinitionAndReference(Class<T> beanType, @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable AnnotationMetadata annotationMetadata, @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo, @Nullable Condition[] preLoadConditions, @Nullable Condition[] postLoadConditions, @Nullable Throwable failedInitialization) -
Method Summary
Modifier and TypeMethodDescriptionfinal StringRepresentsBeanDefinitionReference.getBeanDefinitionName()when the class implementsBeanDefinitionReference.intgetOrder()booleanisEnabled(@NonNull BeanContext context, @Nullable BeanResolutionContext resolutionContext) Return whether this component is enabled for the given context.final booleanisEnabled(BeanContext context, BeanResolutionContext resolutionContext, boolean preCheck) Is enabled bean definition.final booleanMethod returns always true, otherwise class not found would eliminate the instance.final BeanDefinition<T>load(BeanContext context) Loads the bean definition for the currentBeanContext.protected final voidonFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext) Methods inherited from class io.micronaut.context.AbstractInitializableBeanDefinition
checkIfShouldLoad, checkInjectedBeanPropertyValue, configure, configure, containsProperties, containsProperties, containsPropertiesValue, containsPropertyValue, containsValueForField, containsValueForMethodArgument, doInstantiate, equals, findBeanForConstructorArgument, findBeanForField, findBeanForMethodArgument, findMethod, findPossibleMethods, getAnnotationMetadata, getBeanForAnnotation, getBeanForConstructorArgument, getBeanForField, getBeanForMethodArgument, getBeanForSetter, getBeanRegistrationForConstructorArgument, getBeanRegistrationForField, getBeanRegistrationForMethodArgument, getBeanRegistrationsForConstructorArgument, getBeanRegistrationsForField, getBeanRegistrationsForMethodArgument, getBeansOfTypeForConstructorArgument, getBeansOfTypeForField, getBeansOfTypeForMethodArgument, getBeansOfTypeForSetter, getBeanType, getConstructor, getContainerElement, getDeclaredQualifier, getDeclaringType, getEvaluatedExpressionValueForConstructorArgument, getEvaluatedExpressionValueForMethodArgument, getExecutableMethods, getExposedTypes, getInjectedFields, getInjectedMethods, getMapOfTypeForConstructorArgument, getMapOfTypeForField, getMapOfTypeForMethodArgument, getName, getPostConstructMethods, getPreDestroyMethods, getPropertyPlaceholderValueForConstructorArgument, getPropertyPlaceholderValueForField, getPropertyPlaceholderValueForMethodArgument, getPropertyPlaceholderValueForSetter, getPropertyValueForConstructorArgument, getPropertyValueForField, getPropertyValueForMethodArgument, getPropertyValueForSetter, getRequiredArguments, getRequiredComponents, getScope, getScopeName, getStreamOfTypeForConstructorArgument, getStreamOfTypeForField, getStreamOfTypeForMethodArgument, getTypeArguments, getValueForConstructorArgument, getValueForField, getValueForMethodArgument, getValueForPath, hasEvaluatedExpressions, hashCode, hasPropertyExpressions, inject, instantiate, invokeMethodWithReflection, isAbstract, isConfigurationProperties, isContainerType, isInnerConfiguration, isIterable, isMethodResolved, isPrimary, isSingleton, postConstruct, preDestroy, requiresMethodProcessing, setFieldWithReflection, toString, warn, warnMissingPropertyMethods 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.core.annotation.AnnotationMetadataProvider
getAnnotationMetadataMethods inherited from interface io.micronaut.inject.BeanContextConditional
isEnabled, isEnabledMethods inherited from interface io.micronaut.inject.BeanDefinition
asArgument, getBeanDescription, getBeanDescription, getGenericBeanType, getRequiredMethod, getTypeArguments, getTypeArguments, getTypeInformation, getTypeParameters, getTypeParameters, hasAnnotatedMethod, isCandidateBean, isProxy, resolveDynamicQualifierMethods inherited from interface io.micronaut.inject.BeanDefinitionReference
isConfigurationProperties, isContextScope, isProxiedBean, isProxyTarget, isSingleton, loadMethods inherited from interface io.micronaut.inject.BeanType
getBeanName, getExposedTypes, isContainerType, isPrimary, requiresMethodProcessingMethods inherited from interface io.micronaut.inject.InjectableBeanDefinition
injectMethods inherited from interface io.micronaut.inject.InstantiatableBeanDefinition
instantiate, instantiate
-
Constructor Details
-
AbstractInitializableBeanDefinitionAndReference
protected AbstractInitializableBeanDefinitionAndReference(Class<T> beanType, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable @Nullable AnnotationMetadata annotationMetadata, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo) -
AbstractInitializableBeanDefinitionAndReference
protected AbstractInitializableBeanDefinitionAndReference(Class<T> beanType, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodOrFieldReference constructor, @Nullable @Nullable AnnotationMetadata annotationMetadata, @Nullable @Nullable AbstractInitializableBeanDefinition.MethodReference[] methodInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.FieldReference[] fieldInjection, @Nullable @Nullable AbstractInitializableBeanDefinition.AnnotationReference[] annotationInjection, @Nullable @Nullable ExecutableMethodsDefinition<T> executableMethodsDefinition, @Nullable @Nullable Map<String, Argument<?>[]> typeArgumentsMap, @NonNull @NonNull AbstractInitializableBeanDefinition.PrecalculatedInfo precalculatedInfo, @Nullable @Nullable Condition[] preLoadConditions, @Nullable @Nullable Condition[] postLoadConditions, @Nullable @Nullable Throwable failedInitialization)
-
-
Method Details
-
isEnabled
public final boolean isEnabled(BeanContext context, BeanResolutionContext resolutionContext, boolean preCheck) Is enabled bean definition.- Parameters:
context- The bean contextresolutionContext- The resolution contextpreCheck- if it's a pre-load / post-load- Returns:
- true if enabled
-
getBeanDefinitionName
RepresentsBeanDefinitionReference.getBeanDefinitionName()when the class implementsBeanDefinitionReference.- Specified by:
getBeanDefinitionNamein interfaceBeanDefinitionReference<T>- Returns:
- The name of this bean definition
-
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 final boolean isPresent()Method returns always true, otherwise class not found would eliminate the instance.- Specified by:
isPresentin interfaceBeanDefinitionReference<T>- Returns:
- always true
-
getOrder
public int getOrder() -
isEnabled
public boolean isEnabled(@NonNull @NonNull BeanContext context, @Nullable @Nullable BeanResolutionContext resolutionContext) 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
-
onFail
protected final void onFail(io.micronaut.context.DefaultConditionContext<io.micronaut.context.AbstractBeanContextConditional> conditionContext, DefaultBeanContext defaultBeanContext)
-