• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to catch the stop signal from windows service in a java application  RSS feed

 
Hope Zhu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a java application which runs as a service on a windows platform. I would like to find a way to catch the stop signal from the service control window then I will be able to free all resource properly. Anyone knows how to do it please help.

Thanks in advance!
Hope
 
Glenn Murray
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll plead ignorance here: what kind of resources do you need
to free up that won't be freed up by the exiting JVM?

Thanks,
Glenn
 
Jeff Walker
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Hope Zhu:
Hi,

I have a java application which runs as a service on a windows platform. I would like to find a way to catch the stop signal from the service control window then I will be able to free all resource properly. Anyone knows how to do it please help.

Thanks in advance!
Hope


I too plead ignorance, but go to this website. It has at least two solutions, one is way more sophisticated than the other.
http://www.swtech.com/java/ntsvc/

Beware the multitude of annoying popup ads. I don' think you can view the source code without allowing popup ads. Yuk!
-jeff walker
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!