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.AutoCloseable
Represents 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 T
bean()
void
close()
Destroy the bean entry, performing any shutdown and releasing any dependent objects.BeanDefinition<T>
definition()
BeanIdentifier
id()
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 BeanDestructionException
Destroy the bean entry, performing any shutdown and releasing any dependent objects.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
BeanDestructionException
- If an error occurs closing the created bean.
-
-