Package io.micronaut.context
Class DefaultBeanResolutionContext
- java.lang.Object
-
- io.micronaut.context.AbstractBeanResolutionContext
-
- io.micronaut.context.DefaultBeanResolutionContext
-
- All Implemented Interfaces:
BeanResolutionContext
,io.micronaut.core.value.ValueResolver<java.lang.CharSequence>
,java.lang.AutoCloseable
@Internal public final class DefaultBeanResolutionContext extends AbstractBeanResolutionContext
Default implementation ofBeanResolutionContext
.- Since:
- 1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.micronaut.context.AbstractBeanResolutionContext
AbstractBeanResolutionContext.AnnotationSegment, AbstractBeanResolutionContext.ConstructorArgumentSegment, AbstractBeanResolutionContext.ConstructorSegment, AbstractBeanResolutionContext.FieldSegment, AbstractBeanResolutionContext.MethodArgumentSegment, AbstractBeanResolutionContext.MethodSegment
-
Nested classes/interfaces inherited from interface io.micronaut.context.BeanResolutionContext
BeanResolutionContext.Path, BeanResolutionContext.Segment<T>
-
-
Field Summary
-
Fields inherited from class io.micronaut.context.AbstractBeanResolutionContext
context, path, rootDefinition
-
-
Constructor Summary
Constructors Constructor Description DefaultBeanResolutionContext(BeanContext context, BeanDefinition<?> rootDefinition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
addInFlightBean(BeanIdentifier beanIdentifier, BeanRegistration<T> beanRegistration)
Adds a bean that is created as part of the resolution.void
close()
BeanResolutionContext
copy()
Copy current context to be used later.<T> 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, getBean, getBeanRegistrations, getBeansOfType, getContext, getCurrentQualifier, getPath, getRootDefinition, inject, markDependentAsFactory, onNewSegment, popDependentBeans, pushDependentBeans, removeAttribute, setAttribute, setCurrentQualifier, streamOfType
-
-
-
-
Constructor Detail
-
DefaultBeanResolutionContext
public DefaultBeanResolutionContext(BeanContext context, BeanDefinition<?> rootDefinition)
- Parameters:
context
- The bean contextrootDefinition
- The bean root definition
-
-
Method Detail
-
copy
public BeanResolutionContext 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
public void removeInFlightBean(BeanIdentifier beanIdentifier)
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
@Nullable public <T> BeanRegistration<T> getInFlightBean(BeanIdentifier beanIdentifier)
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
-
-