Package io.micronaut.context.scope
Interface CreatedBean<T>
-
- Type Parameters:
T- The bean type
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
BeanRegistration
public interface CreatedBean<T> extends java.io.Closeable, java.lang.AutoCloseableRepresents a bean that has been created from aBeanCreationContext.- Since:
- 3.0.0
- See Also:
BeanCreationContext,BeanCreationContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tbean()voidclose()Destroy the bean entry, performing any shutdown and releasing any dependent objects.BeanDefinition<T>definition()BeanIdentifierid()Returns an ID that is unique to the bean and can be used to cache the instance if necessary.
-
-
-
Method Detail
-
definition
BeanDefinition<T> definition()
- Returns:
- The bean definition.
-
bean
@NonNull T bean()
- Returns:
- The bean
-
id
BeanIdentifier id()
Returns an ID that is unique to the bean and can be used to cache the instance if necessary.- Returns:
- The id
-
close
void close() throws BeanDestructionExceptionDestroy the bean entry, performing any shutdown and releasing any dependent objects.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
BeanDestructionException- If an error occurs closing the created bean.
-
-