Interface StatefulObjectFactory<T>

  • All Known Implementing Classes:
    StatefulSessionComponent

    public interface StatefulObjectFactory<T>
    Creates and destroys stateful objects.

    The object returned by create has dependencies injected. The PostConstruct callback, if defined, has been called. It'll not call back on the appropriate Init method.

    Version:
    $Revision: $
    Author:
    Carlo de Wolf
    • Method Detail

      • createInstance

        T createInstance()
        Create a new instance of this component. This may be invoked by a component interceptor, a client interceptor, or in the course of creating a new client, or in the case of an "eager" singleton, at component start. This method will block until the component is available. If the component fails to start then a runtime exception will be thrown.

        The instance has been injected and post-construct has been called.

        Returns:
        the component instance
      • destroyInstance

        void destroyInstance​(T instance)
        Destroy an instance of the component. This method causes all uninjection and pre-destroy lifecycle invocations to occur.
        Parameters:
        instance - the instance to destroy