Class DefaultBeanResolutionContext
java.lang.Object
io.micronaut.context.AbstractBeanResolutionContext
io.micronaut.context.DefaultBeanResolutionContext
- All Implemented Interfaces:
BeanLocator, BeanResolutionContext, ConversionServiceProvider, ValueResolver<CharSequence>, AutoCloseable
Default implementation of
BeanResolutionContext.- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractBeanResolutionContext
AbstractBeanResolutionContext.AbstractSegment<B,T>, AbstractBeanResolutionContext.AnnotationSegment<B>, AbstractBeanResolutionContext.ConstructorArgumentSegment, AbstractBeanResolutionContext.ConstructorSegment, AbstractBeanResolutionContext.EventListenerSegment<B, T>, AbstractBeanResolutionContext.FieldSegment<B, T>, AbstractBeanResolutionContext.MethodArgumentSegment, AbstractBeanResolutionContext.MethodSegment<B, T> Nested classes/interfaces inherited from interface BeanResolutionContext
BeanResolutionContext.Path, BeanResolutionContext.Segment<B,T> -
Field Summary
Fields inherited from class AbstractBeanResolutionContext
context, path, rootDefinition -
Constructor Summary
ConstructorsConstructorDescriptionDefaultBeanResolutionContext(BeanContext context, @Nullable BeanDefinition<?> rootDefinition) -
Method Summary
Modifier and TypeMethodDescription<T> voidaddInFlightBean(BeanIdentifier beanIdentifier, BeanRegistration<T> beanRegistration) Adds a bean that is created as part of the resolution.voidclose()copy()Copy current context to be used later.<T> @Nullable BeanRegistration<T> getInFlightBean(BeanIdentifier beanIdentifier) Obtains an inflight bean for the given identifier.voidremoveInFlightBean(BeanIdentifier beanIdentifier) Removes a bean that is in the process of being created.Methods inherited from class AbstractBeanResolutionContext
addDependentBean, copyStateFrom, destroyInjectScopedBeans, findBean, findBean, findBeanDefinitions, get, get, getAndResetDependentBeans, getAndResetDependentFactoryBean, getAttribute, getAttributes, getBean, getBean, getBean, getBeanRegistration, getBeanRegistrations, getBeansOfType, getBeansOfType, getBeansOfType, getBeansOfType, getConfigurationPath, getContext, getConversionService, getCurrentQualifier, getPath, getPropertyResolver, getProxyTargetBean, getProxyTargetBean, getRootDefinition, mapOfType, markDependentAsFactory, popDependentBeans, pushDependentBeans, removeAttribute, resolvePropertyValue, setAttribute, setAttributes, setConfigurationPath, setCurrentQualifier, streamOfType, streamOfType, valueResolvedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BeanLocator
findBean, findBean, findOrInstantiateBean, getBean, getBean, getProvider, getProvider, getProvider, getProvider, getProxyTargetBean, mapOfType, mapOfType, mapOfType, streamOfType, streamOfTypeMethods inherited from interface ValueResolver
get, get
-
Constructor Details
-
DefaultBeanResolutionContext
public DefaultBeanResolutionContext(BeanContext context, @Nullable BeanDefinition<?> rootDefinition) - Parameters:
context- The bean contextrootDefinition- The bean root definition
-
-
Method Details
-
copy
Description copied from interface:BeanResolutionContextCopy current context to be used later.- Returns:
- The bean resolution context
-
close
public void close() -
addInFlightBean
public <T> void addInFlightBean(BeanIdentifier beanIdentifier, BeanRegistration<T> beanRegistration) Description copied from interface:BeanResolutionContextAdds a bean that is created as part of the resolution. This is used to store references to instances passed toBeanContext.inject(Object).- Type Parameters:
T- The instance type- Parameters:
beanIdentifier- The bean identifierbeanRegistration- The bean registration
-
removeInFlightBean
Description copied from interface:BeanResolutionContextRemoves a bean that is in the process of being created. This is used to store references to instances passed toBeanContext.inject(Object).- Parameters:
beanIdentifier- The bean identifier
-
getInFlightBean
Description copied from interface:BeanResolutionContextObtains an inflight bean for the given identifier. An "In Flight" bean is one that is currently being created but has not finished construction and been registered as a singleton just yet. For example in the case whereby a bean as aPostConstructmethod that also triggers bean resolution of the same bean.- Type Parameters:
T- The bean type- Parameters:
beanIdentifier- The bean identifier- Returns:
- The bean
-