yeah.
Done.
Thanks to all people who have give me a hand.
When use shutdown() in MBean, the JBoss can't really shutdown.
When use exit(int) in MBean, the JBoss will shutdown after deploying all
deployment,.
When use halt(int) in MBean, the JBoss immediately shutdown.
Thus, I use halt
Because I must shutdown the JBoss when the my application server's
initializaion is not complete.
So far I don't know any other way to stop JBoss except calling System.exit().
But now, I will take your advice to try to use shutdown() method in
org.jboss.system.Server.
View the original post :
So why don't you call shutdown() on the MBean jboss.system.Server?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3896296#3896296
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3896296
--
THX.
But my purpose is to stop JBoss via calling System.exit(), not to prevent
others to halt the JVM.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3896263#3896263
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3896
If I should have to write an application server, I would install a
SecurityManager with an overwritten checkExit method, so nobody can halt the
system just by calling System.exit() within deployed code ;-)
Read this regarding threads (daemon threads) and the system exit.
http://java.sun.com/j2se
I don't think so.
Well, in the javadoc of System.exit(int ), it says that: the method will halt
the entire JVM. When the entire JVM is halted, then all threads running in it
will be certainly terminated. So your guess is not possible.
Any other advice please.
View the original post :
http://
Here is my guess.
JBoss is muti-threaded. The only thing that System.exti(-1) accomplished is
that it killed the thread you were running on and set the program exit code.
The other threads are still running. To successfully kill the whole
application, you must terminate all of the threads.