Re: [Aglets-users] need to run a code in a different process
Status: Beta
Brought to you by:
cat4hire
From: Luca F. <cat...@us...> - 2005-06-22 07:28:55
|
On Tuesday 21 June 2005 13:51 Hala Nafei's cat walking on the keyboard wrote: > I want to make the aglet shutdown the hosts then return to the server. > I tryed to make the Runtime.getRuntime.exec("shutdown -s -t 60") in a > different thread but the problem that the agent wait for the thread to > finish work so the host shutdown and the agent doesn't return. I want the > code of shutdown run independent of the aglet. > > Can anyone help plz? > What you send the process in background? "shutdown -s -t 60 &" The Process object you obtain from the exec call is a separate process, and in fact you have to explicity do a waitFor to wait the end of the process, so it should work fine. Luca -- +-------------------------------------------+ Luca Ferrari, cat...@us... The Aglets project: http://aglets.sourceforge.net +-------------------------------------------+ |