I was facing the same issue, and I think the answer is that when you create your SocketCreator(), you also pass in an Executor implementation. By doing that, you can control how the Threads are being created, and make them into daemon threads.
Take a look at: http://docs.huihoo.com/javadoc/apache/mina/1.1.7/org/apache/mina/transport/socket/nio/SocketConnector.html#SocketConnector%28int,%20java.util.concurrent.Executor%29 Shaun On Wed, Apr 7, 2010 at 11:10 PM, David Rosenstrauch <[email protected]> wrote: > On 04/07/2010 04:10 AM, Bergman, Yosi wrote: >> >> Hi, >> >> I saw a couple of messages but could not find any answer. >> >> (http://old.nabble.com/Mina-Client-Quick-Shutdown-ts21417062.html#a21417062) >> How do I make all MINA threads (especially IoHandler) a daemon thread ? >> Even just for development reasons, I want the process to shutdown once the >> main (user) thread is terminating. >> >> Thanks. >> >> Yosi. > > ? Aren't they already? > > Here's what I do to shut down my Mina server: > > at startup: > ... > protocolAcceptor = new NioSocketAcceptor(); > ... > protocolAcceptor.bind(); > ... > > > > at shutdown: > ... > protocolAcceptor.unbind(); > protocolAcceptor.dispose(); > ... > > > The process seems to shut down fine after that. > > DR >
