Interface ContainedBean<B>

All Superinterfaces:
ManagedBean<B>

@SPI({USE,IMPLEMENT,SUPPLY}) public interface ContainedBean<B> extends ManagedBean<B>
A bean handle with lifecycle hooks for its owning BeanContainer. Consumers access the bean through ManagedBean; the container uses initialize() and release() to manage its lifecycle. Custom containers implement and supply these handles from their acquisition methods.

Consumers must request release through the managed bean registry or BeanContainer.releaseBean(ManagedBean), rather than invoking release() directly, so cache eviction and lifecycle bookkeeping take place as well.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initialize the bean if necessary.
    void
    Release resources associated with this handle without forcing initialization.

    Methods inherited from interface ManagedBean

    getBeanClass, getBeanInstance
  • Method Details

    • initialize

      @SPI({USE,IMPLEMENT}) void initialize()
      Initialize the bean if necessary. Already initialized handles may do nothing.
    • release

      @SPI({USE,IMPLEMENT}) void release()
      Release resources associated with this handle without forcing initialization. Handles with no resources to release may do nothing.