Package io.micronaut.context
Class DefaultBeanResolutionContext
java.lang.Object
io.micronaut.context.AbstractBeanResolutionContext
io.micronaut.context.DefaultBeanResolutionContext
- All Implemented Interfaces:
BeanResolutionContext
,ValueResolver<CharSequence>
,AutoCloseable
Default implementation of
BeanResolutionContext
.- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.context.AbstractBeanResolutionContext
AbstractBeanResolutionContext.AnnotationSegment<B>, AbstractBeanResolutionContext.ConstructorArgumentSegment, AbstractBeanResolutionContext.ConstructorSegment, AbstractBeanResolutionContext.FieldSegment<B,
T>, AbstractBeanResolutionContext.MethodArgumentSegment, AbstractBeanResolutionContext.MethodSegment<B, T> Nested classes/interfaces inherited from interface io.micronaut.context.BeanResolutionContext
BeanResolutionContext.Path, BeanResolutionContext.Segment<B,
T> -
Field Summary
Fields inherited from class io.micronaut.context.AbstractBeanResolutionContext
context, path, rootDefinition
-
Constructor Summary
ConstructorDescriptionDefaultBeanResolutionContext
(BeanContext context, BeanDefinition<?> rootDefinition) -
Method Summary
Modifier and TypeMethodDescription<T> void
addInFlightBean
(BeanIdentifier beanIdentifier, BeanRegistration<T> beanRegistration) Adds a bean that is created as part of the resolution.void
close()
copy()
Copy current context to be used later.<T> @Nullable BeanRegistration<T>
getInFlightBean
(BeanIdentifier beanIdentifier) Obtains an inflight bean for the given identifier.void
removeInFlightBean
(BeanIdentifier beanIdentifier) Removes a bean that is in the process of being created.Methods inherited from class io.micronaut.context.AbstractBeanResolutionContext
addDependentBean, copyStateFrom, destroyInjectScopedBeans, findBean, get, get, getAndResetDependentBeans, getAndResetDependentFactoryBean, getAttribute, getAttributes, getBean, getBeanRegistrations, getBeansOfType, getConfigurationPath, getContext, getCurrentQualifier, getPath, getRootDefinition, mapOfType, markDependentAsFactory, onNewSegment, popDependentBeans, pushDependentBeans, removeAttribute, setAttribute, setAttributes, setConfigurationPath, setCurrentQualifier, streamOfType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.value.ValueResolver
get, get
-
Constructor Details
-
DefaultBeanResolutionContext
- Parameters:
context
- The bean contextrootDefinition
- The bean root definition
-
-
Method Details
-
copy
Description copied from interface:BeanResolutionContext
Copy 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:BeanResolutionContext
Adds 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:BeanResolutionContext
Removes 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:BeanResolutionContext
Obtains 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 aPostConstruct
method that also triggers bean resolution of the same bean.- Type Parameters:
T
- The bean type- Parameters:
beanIdentifier
- The bean identifier- Returns:
- The bean
-