Initialization Component assembly and configuration.This happens lazily after registration. If you call start() (below) if will force the container to iterate thru the components and instantiate in order, resolving dependancies and configuration concerns as it goes. Some Pico containers maye choose a late strategy, others early. StartableLifecycleManagerThis interface is implementable by a Pico container. It indicates that the container can handle lifecycling of components it contains. StartingAfter Initialization a component may be started. In fact this happens after all of the components have been initialized. It is subject to the pluggable implementation, but it generally means that start() will be called if it is present on a component. It is entirely optional. It is likely to be used for the starting of threads or opening of socket listeners. Start() can be repeatedly called provided stop() has been called between start invocations. For PicoContainers that implement LifecycleContainer, if start() is called at the container level, it is percolated all the way thru to the components. StoppingFor PicoContainers that implement LifecycleContainer, if stop() is called at the containerlevel, it is percolated all the way thru to the components. In the reverse order of assembly, the components will be stopped. All the pluggability comments for Starting are true for stopping. DisposalAgain pluggable in implementation and enforced by LifecycleContainer, dispose() can be called on the container and percolated all the way thru to the contained components. Once called the container is effectively dead. Of course, different pico containers may choose to handle this differently. --- LifecycleContainer Interface public interface LifecycleContainer extends Container { void start() throws PicoStartException; void stop() throws PicoStopException; } This adds some life cycle management to Pico Containers. The instantiating class may call start() on the container which, subject to implementation does some conceptual start on the components that optionally recognize the applicable start design. This may of use when a thread is needed to be started (private to the component) for some daemonized life. It is a pluggable implementation (along Pico Component designs) of course. The default being a NullObject implementation. |