+1 for IoHandler Just thinking about the Use Cases for IoServiceListeners. If we have it, what could we achieve by having it. One thing is could have Event listeners which can do custom functionality on these events. Like if serviceInactive event, might want to close some resources, and acquire them in serviceActivated/Created.
Agree that these functions are similar to functions in IoHandler, but how do we invoke multiple listeners from IoHandler? BTW, this might not be a valid Use Case, just trying to get some food for thoughts :) Lets debate, and if we don't need it lets remove it. thanks ashish On Tue, Nov 13, 2012 at 5:28 PM, Julien Vermillard <[email protected]>wrote: > Hi, > I'm reintroducing IoHandler in mina 3. > > The idea is to have one Iohandler per IoService : > > {snip} > final NioTcpServer server = new NioTcpServer(); > // create the fitler chain for this service > server.setFilters(securityFilter,codec,logging); > > server.setIoHanlder( new DefaultIoHandler() { > > // here your business logic > > }); > server.bind(); > {snip} > > I found we have another IoService bound listener : > > public interface IoServiceListener extends EventListener { > > void serviceActivated(IoService service); > > void serviceInactivated(IoService service); > > void sessionCreated(IoSession session); > > void sessionDestroyed(IoSession session); > } > > It's quite redundant with IoHandler, I propose to fusion the two listener > into the IoHandler > > WDYT ? > Julien > -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal
