Package io.micronaut.context.scope
Interface BeanCreationContext<T>
-
- Type Parameters:
T
- The bean type
public interface BeanCreationContext<T>
Context object passed toCustomScope
instances for creating new beans.- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CreatedBean<T>
create()
Create a new instance.BeanDefinition<T>
definition()
BeanIdentifier
id()
-
-
-
Method Detail
-
definition
@NonNull BeanDefinition<T> definition()
- Returns:
- The bean definition
-
id
@NonNull BeanIdentifier id()
- Returns:
- An ID that can be used to store the created bean instance
-
create
@NonNull CreatedBean<T> create() throws BeanCreationException
Create a new instance.Implementations of
CustomScope
should callCreatedBean.close()
to dispose of the bean at the appropriate moment in the lifecycle of the scope- Returns:
- The
CreatedBean
instance - Throws:
BeanCreationException
- If the bean failed to create
-
-