Microsoft SDK for Java

com.ms.service Package Overview

Microsoft Packages Overview

The com.ms.service package enables you to write a Microsoft® Windows NT® system service in Java. (System services do not work under Microsoft® Windows® 98.) For more information about Windows NT system services, refer to the MSDN™ Library.

This package contains the following:

Classes

Hierarchy

To create and use a Windows NT service using this package, you must perform the following steps:

  1. Create your own service class by deriving it from the Service class.

  2. Implement either a default constructor with no parameters or a constructor with a single String[] parameter. This constructor will be used to instantiate the service, and it should perform initialization during ServiceMain.

  3. Implement your own versions of service callback methods (the methods that start with handle) to handle the various system service requests.

  4. Use the query methods (the methods that begin with can) to determine which controls are accepted by a service (instead of testing the flags returned from getControlsAccepted).

  5. Use a built-in assassin to terminate a service that exceeds a time-out period specified by the wait hint value in status updates.

  6. Use the jntsvc tool to generate a self-contained, self-installing and uninstalling, redistributable executable for the service.

  7. After generating the executable, install and run the service.

For instructions on generating a service executable using the jntsvc tool, and on installing, uninstalling, and running the executable, see the jntsvc section of the Tools Reference.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.