mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <pro...@apache.org>
Subject mina component lifecycles
Date Sat, 04 Mar 2006 03:56:12 GMT
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

	
-- 
proyal@apache.org - http://fotap.org/~osi



Mime
View raw message