I think we mainly need a 'disposal' phase, for when things are no longer needed. init/start/stop could be added, but I'm not sure we need them yet.

When running "containerless", we can have a BasicLifecycleManager. This is just a convenience to do disposal on a bunch of components in one shot.

to take the sumup.Client example:

        ThreadPoolFilter ioThreadPoolFilter = new ThreadPoolFilter();
ThreadPoolFilter protocolThreadPoolFilter = new ThreadPoolFilter();
        IoConnector connector = new SocketConnector();
        connector.getDefaultConfig().getFilterChain().addFirst(
                "ioThreadPool", ioThreadPoolFilter );
        connector.getDefaultConfig().getFilterChain().addLast(
                "protocolThreadPool", protocolThreadPoolFilter );

users would then also do

        BasicLifecycleManager lm = new BasicLifecycleManager();

        lm.add( ioThreadPoolFilter );
        lm.add( protocolThreadPoolFilter );
        lm.add( connector );

and then, when the system is done:

        lm.dispose();

.. for users integrating into a container, they would not use BasicLifecycleManager at all. the lifecycles would be managed by the container.

thoughts?

-pete

        
--
[EMAIL PROTECTED] - http://fotap.org/~osi


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to