Thomas Boerkel has contributed some mappings and code to the JNA project to facilitate access to Windows' user accounts, registry, and NT services. Included is an abstract class which is capable of installing, uninstalling, and running itself as an NT service. What sets this little gem apart from most available wrappers is that you don't need a Windows executable stub; the complete Windows service API is available to your Java program, including all system events and callbacks.
You can browse the source here. A NetBeans project is included.
I was working on an abstract service class as well but Thomas beat me to completion. Great work, Thomas!
Update: Make sure your classpath and classes are accessible by the local system account, or the service won't be able to start. To see if this is the issue, you can temporarily change the service to start using your user identity; if it works, then the problem is that the local system account doesn't have access.
Showing posts with label nt service. Show all posts
Showing posts with label nt service. Show all posts
Wednesday, September 12, 2007
Subscribe to:
Comments (Atom)