Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutdownhook

Status
Not open for further replies.

Durkin

Programmer
Nov 6, 2000
304
GB
Hi. I am writing a java app that will be used as a windows service (using srvany.exe). I want to use a shutdownhook to clear up remaining threads when the service is stopped or the machine shutdown. However my shutdown hook is not firing. I have tried adding it both in the main method and the constructor for the main class and neither works. Any ideas? Durkin
 
>> shutdownhook

do you mean java.rmi.activation.ActivationSystem.shutdown()?

please clarify. be specific.

-pete
 
You can put it, whatever it is, in a finalize method in your main class.

"When you have eliminated the impossible, whatever remains, however
improbable, must be the truth." ~ Arthur Conan Doyle
 
Durkin,

Did you ever resolve this? I am having a similar problem. Have installed a shutdown hook but when I stop the service in NT the hook does not fire.

Earnie!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top