发信人: svga()
整理人: zjxyz(2001-05-10 22:14:21), 站内信件
|
Run JAVA as a NT service
----------------------------------------------------------------------
----------
You can use the utility SRVANY.EXE, included with the NT resource Kit.
Installation of a service
copy SRVANY.EXE and install it as a NT services, like: INSTSRV MyServi
ce c:\tools\srvany.exe
configure via the Services applet("Startup..." dialog) of the Control
Panel as manual or automatic
set via via the Services applet the account for the service. If you ne
ed access to the screen & keyboard, you must choose the LocalSystem ac
count and click the "Allow Service to Interact with Desktop".
run REGEDIT and create the following PARAMETERS key :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servics\MyService
Application=<path of the application with the extension>
AppParameters=<the parameters for the application> (optional)
AppDirectory=<the current directory to use for the application (option
al)
To execute a JAVA program as a service:
Create the service with INSTSRV JavaService c:\tools\srvany.exe
Specify in the Control Panel if it's manual or automatic
In the REGISTRY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servics\JavaService
Application=c:\jdk1.1\bin\java.exe
AppParameters=c:\java\classes\myClass
AppDirectory=c:\java\classes
The benefits are :
Allow applications to survive logoff/logon sequences, hence saving ove
rhead of re-starting them for each new user
allow server to come-up and service requests even when no user is logg
ed on
allow applications to run and perform a task in a specific logon accou
nt, different from the currently logged-on user.
Starting and Stopping :
If configured as automatic, the user doesn't need to start it explicit
ely: it is started automatically every time the system is re-booted. F
or manual services, the user may start a service with :
(with the SC.EXE utility) ex. SC start MyService or with NET START
MyService
SC stop MyService or NET STOP
MyService
To de-install a service :
INSTSRV MyService remove
Also in the Microsoft SDK 2.0, a package called com.ms.service that pr
ovides this functionality is included. Some utilities and demos are in
cluded. Check the Microsoft JAVA Web site for more infos.
NOTE These Microsoft utilities can't be freely distributed. You may wa
nt to take a look at invoker, a freeware equivalent of MS srvany.exe f
or running executables as services.
---------------------------------------------------------------------- ----------
Author: Real Gagnon
Author's WebSite: http://tactika.com/realhome/realhome.html
You can use the utility SRVANY.EXE, included with the NT resource Kit.
Installation of a service
copy SRVANY.EXE and install it as a NT services, like: INSTSRV MyServi ce c:\tools\srvany.exe
configure via the Services applet("Startup..." dialog) of the Control Panel as manual or automatic
set via via the Services applet the account for the service. If you ne ed access to the screen & keyboard, you must choose the LocalSystem ac count and click the "Allow Service to Interact with Desktop".
run REGEDIT and create the following PARAMETERS key :
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servics\MyService
Application=<path of the application with the extension>
AppParameters=<the parameters for the application> (optional)
AppDirectory=<the current directory to use for the application (option al)
To execute a JAVA program as a service:
Create the service with INSTSRV JavaService c:\tools\srvany.exe
Specify in the Control Panel if it's manual or automatic
In the REGISTRY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servics\JavaService
Application=c:\jdk1.1\bin\java.exe
AppParameters=c:\java\classes\myClass
AppDirectory=c:\java\classes
The benefits are :
Allow applications to survive logoff/logon sequences, hence saving ove rhead of re-starting them for each new user
allow server to come-up and service requests even when no user is logg ed on
allow applications to run and perform a task in a specific logon accou nt, different from the currently logged-on user.
Starting and Stopping :
If configured as automatic, the user doesn't need to start it explicit ely: it is started automatically every time the system is re-booted. F or manual services, the user may start a service with :
(with the SC.EXE utility) ex. SC start MyService or with NET START MyService
SC stop MyService or NET STOP MyService
To de-install a service :
INSTSRV MyService remove
Also in the Microsoft SDK 2.0, a package called com.ms.service that pr ovides this functionality is included. Some utilities and demos are in cluded. Check the Microsoft JAVA Web site for more infos.
NOTE These Microsoft utilities can't be freely distributed. You may wa nt to take a look at invoker, a freeware equivalent of MS srvany.exe f or running executables as services.
-- _$~\_/~$_
( ) 我是一个坏男孩,因为我想发财
___
如果你是方便面,那么我就是开水
我要 泡 你
※ 修改:.svga 于 Apr 20 17:49:33 修改本文.[FROM: 61.129.7.57] ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 61.129.7.57]
|
|