Interface CreatedBean<T>

Type Parameters:
T - The bean type
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BeanRegistration

public interface CreatedBean<T> extends Closeable, AutoCloseable
Represents a bean that has been created from a BeanCreationContext.
Since:
3.0.0
Author:
graemerocher
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull T
     
    void
    Destroy the bean entry, performing any shutdown and releasing any dependent objects.
     
    id()
    Returns an ID that is unique to the bean and can be used to cache the instance if necessary.
  • Method Details

    • definition

      BeanDefinition<T> definition()
      Returns:
      The bean definition.
    • bean

      @NonNull T bean()
      Returns:
      The bean
    • 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      BeanDestructionException - If an error occurs closing the created bean.