JavaService - Developer Introduction

Summary

JavaService is a software utility for the Windows NT environment, allowing a Java application to be installed and run in the background as a system service.

Once the application is installed using JavaService, it can be run automatically on system startup and may be controlled using the standard Windows system administration tools.

Background

Server-type applications run without a user interface, usually accepting network communications from client programs to perform processing. Typical applications of this type include web servers, file transfer servers, database management systems and J2EE application servers (for example: Apache, MySQL and JoNAS).

The Java programming language provides a cross-platform environment for the development and execution of client and server programs. This does not provide any intrinsic support for background process control as there is no standard way for this to be implemented.

Within a UNIX or Linux system, server applications may be run in the background as 'daemon' processes, initiated by a startup script. This mechanism is not supported in Windows systems; instead, 'system services' are defined to run programs in the background.

The JavaService software provides the link between the cross-platform Java environment and the system service handling of Microsoft Windows. It achieves this without requiring any changes to the underlying Java application code of the server application.

The JavaService software is bundled with a number of Java applications, and may be downloaded and used with many utilities and programs that need this functionality in a Windows system for continuous execution of Java server processes.

Functionality

JavaService itself is Windows application software, that provides a number of functions. Those of most interest to users of this software are listed below:

Service Installation
Allowing a Java application to be installed and configured as a system service
Service Execution
Runs the Java code in the background, under control of the Windows Service Handler
Service Removal
Perform cleanup and un-installation of a service previously installed by JavaService

An application may be installed as a service for automatic or manual execution using the JavaService 'install' command, and can be removed using the JavaService 'uninstall' command. For details of the commands supported by JavaService, refer to the command descriptions document.

The installed service may be stopped and started using Windows 'net start' and 'net stop' commands, or execution status may be changed from Windows Administration Tools.

Requirements

In order that a Java application can be executed as a Windows system service, the following requirements must be met:

Restrictions

The following limitations apply to the use of JavaService in running Java applications as Windows system services: