Listen on a socket on local host.  If an incoming message matches your 
"shutdown" command, call acceptor.unbind() and then executor.shutdown (in that 
order).

acceptor.unbind() will cause the server to stop listening for incoming 
connections.
executor.shutdown() will cause the executor to stop providing threads.  Any 
threads already performing work should complete.

I use a daemon thread in the ExecutorFilter of my "shutdown" acceptor.  That 
way I don't need to worry about "shutting down" the executor in my shutdown 
handler.

Your incoming "shutdown" message can be as simple or complex as you like.  If 
you only listen on localhost and have a firewall blocking outside access a 
simple string match is sufficient.  If your going to be listening on an 
externally accessible socket you could use client side SSL certs to verify the 
client, etc.

Rob

----- Original Message ----
From: threadMaven <[EMAIL PROTECTED]>
To: [email protected]
Sent: Tuesday, September 4, 2007 3:17:46 PM
Subject: Serverside shutdown


So I have a server implementation, 1 acceptor , 4 x I/O processors. The
tutorial (Quick Start; configuring thread model) states the server code is
responsible for the acceptor.unbind(...) and the executor.shutdown(...).  So
my question is are there any suggested mechanisms by which I should  be
"signalling" my serverside process and then how do I detect that all my I/O
threads are done and can proceed with my "unbind"/"shutdown"....

Thx all
-- 
View this message in context: 
http://www.nabble.com/Serverside-shutdown-tf4379780s16868.html#a12484795
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.






      
____________________________________________________________________________________
Shape Yahoo! in your own image.  Join our Network Research Panel today!   
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


Reply via email to