[defines] PATH = c:\java\test JAVA = %JAVA_HOME% PP = %PATH% P1 = %P2% P2 = %PP% [service] appname = TelnetEcho servicename = TelnetEcho displayname = TelnetEcho servicedescription = Description for Telnet Echo ;environment variable substitution is possible in any value ;e.g. ;jrepath=%JAVA_HOME% ;% is escaped by %% ;Size of internal buffer for string handling ;increase if you use very long command line parameters e..g a big classpath stringbuffer = 16000 ;port used to communicate stop command to JVM ;Must be unique for each JSL instance installed ;This option is ignored if a stop method is defined further down ;stopport = 8465 ;delay n milliseconds to start the Java VM ;Default is no start delay ;startdelay = 10000 ;service dependencies can be added ;as a comma separated string "dep1,dep2" ;dependencies=depend2 ;service start type ;auto demand disabled ;default is auto starttype=auto ;load ordering group loadordergroup=someorder ;account under which service runs ;default is system ;account=.\administrator ;password for above account ;system need not provide a password ;password=somewpd ;Allocate a console and register a console event handler to catch shutdown events. ;Default is true; options are FALSE TRUE false true YES NO yes no ;This option has two effects: ;1. If active it catches the logoff events and prevents the service from erroneously stopping in this case. ;2. It creates a console window if interaction with the desktop is allowd. ;Effect 1 can be achieved in Java 1.3.1 and higher by using the -Xrs option. ;Effect 2 may or may not be desired. useconsolehandler=false ;Call . through JNI so stop the JVM. ;This can be used an alternative to the ServiceStopper ;When all three parameters are defined the JSL will try to use JNI to stop the service. ;If not it will use a tcp/ip connection to the stopport. ;The simplest way to use this functionality is to use the Systen.exit() call as specified below. ;Nevertheless you can call any static method in your code. ;The method called is expected to terminate the JVM one way or the other. It can directly ;call System.exit() or make another Thread do it make the main method return. ;The method can return imediately if desired. If the JVM doesn't stop another attempt can be made to ;stop the service at a later time. stopclass=java/lang/System stopmethod=exit ;Take care to specify the right signature for your method. void System.exit( int code ) has ;the sifnature specified below. void myMethod() has the signature ()V. Please refer to the ;JNI documentation for details. stopsignature=(I)V ;Name and signature of service pause method. Will be called on a SERVICE_CTRL_PAUSE event. ;Please note that unless you have configured all pause and continue arguments ;you will not see the pause button enbaled in the service control manager GUI ;pauseclass=TelnetEcho ;pausemethod=pause ;pausesignature=()V ;Name and signature of service pause method. Will be called on a SERVICE_CTRL_CONTINUE event. ;Please note that unless you have configured all pause and continue arguments ;you will not see the pause button enbaled in the service control manager GUI ;contclass=TelnetEcho ;contmethod=cont ;contsignature=()V ;Value of the PATH environement variable being set by the service. ;PATH will remain unchanged if this is empty. ;path=c:\util ;Redirect C level stdout and stderr to the specified files ;Please note that those are diffrent files then the ones used below for ;Java level stdout and stderr ;Default is no redirection ;stdout=c:\stdout.log ;stdoutappend=no ;stderr=c:\stderr.log ;stderrappend=no ;Redirect JAVA level System.out and System.err to the specified files ;This simply sets new output streams for System.out and System.err after ;the JVM is initialized but before the main method is called. ;You might find that this option has no effect at all for some applications, as the ;JAVA application is of course free to redirect System.out and System.err ;to some other log mechanism. ;Default is no redirection ;Default is to overwrite file ;systemout=c:\systemout.log ;systemoutappend=no ;systemerr=c:\systemerr.log ;systemerrappend=no ;This method will be called before the main method of the start class specified on command line ;but after the JVM is fully initialized and stdout and stderr redirection have been performed. ;This method must return! It is called from the same thread as the main method. ;In order for the normal JVM start behaviour to continue this method must return 0. ;I may legally return any other value or throw any exception, which in both cases will result in ;a regular termination of the JVM much in the same way as if an uncatched exception had been thrown ;in the main method. ;It may legally start other threads in the JVM, which will behave in the same way as started from ;the main method. ;In fact you will be able to produce pretty much the same behaviour as calling the static method first in ;your main method. ;The example method present here is a scheduler which will in turn run the code specified ;in its modules list. Some utilities are provided. ;premainclass=com/roeschter/jsl/PreMainScheduler premainmethod=run premainsignature=()I premain.modules=threaddump premain.threaddump.class=com.roeschter.jsl.ThreadDumpListener premain.threaddump.method=start premain.threaddump.wait=3000 premain.threaddump.critical=no premain.threaddump.interface=127.0.0.1 ;Report service stopped on exit of main thread ;you might want to set this to yes if your service terminates "silently" ;It is recommended that a service is stopped by calling System.exit() at some time, ;either externally or internally. This provides a nice and clean shutdown hook. ;If the service terminates silently by just ending the last thread this might result ;in the service manager not recognizing the fact and denying restart. Use yes in this case. ;It should usually be safe to use reportservicestoppedonmainthreadexit=true ;even if you use other threads then main. The shutdown code will wait for non daemon threads to stop ;I can't remember why I made this parameter optional. It must have been useful for some people or in some situations ;Default is no ;reportservicestoppedonmainthreadexit = no ;Behaviour in case of JVM exiting with an error ;Define whether an execption in the main method should be considered an error ;Use this exit code in case of an exception. ;exceptionerrorcode=0 ;Desired behaviour for a non zero exit code (including exceptions as specified above) ;Options: ;ignore terminate without error (default) ;returncode exit with error code reported by the JVM to to the service manager ;fatal don't report regular service stop to service manager making it believe ;a fatal error had occured in the service (this is sometimes desirable if fatal error ;recovery mechanisms are in place) ;onexiterror=fatal ;Use this executable for registering the service. ;Default is the executable used for installation ;modulepath="e:\java\test\jsl_0_9_9e\release\jsl.exe -ini e:\java\test\jsl_0_9_9e\release\jsl2.ini" [java] ;Path to the java runtime used ;If this option is not used the default from the registry will be used ;jrepath=c:\java\jdk15 ;Type of jvm to be used. Alternative mechanism to specifiying -client or -server on the command line. ;Can use any JVM name, which is diffrent from the command line which will only allow -client and -server ;Useful when using a JVM diffrent from Suns implementation. ;jvmtype=server ;working directory ;wrkdir=e:\java\test ;the number of paramters passed to the java application ;parameters must be named param00, param01 ... ;Please note that each command line parameter has to go on it's own parameter value here! ;The way the JVM is called in JSL, the JVM expects a preparsed array of parameters. ;Everything seperated by whitespace on a java command line is broken down into a parameter here. ;You don't need to care about quotes ;around strings containing spaces here. e.g. ;java.exe -cp "c:\program files\test\lib.jar" com.test.Java "test.>" ;becomes ;params = 4 ;param00 = -cp ;param01 = c:\program files\test\lib.jar ;param02 = com.test.Java ;param03 = test.> ;params = 6 ;param00 = -cp ;param01 = e:\java\test\jsl_0_9_9e\src ;param02 = com.roeschter.jsl.StopTest ;param03 = -exitMain ;param04 = -startThread ;param05 = -callExitThread ;params = 4 ;param00 = -Xss20m ;param01 = -cp ;param02 = e:\java\test\jsl_0_9_9f\src ;param03 = com.roeschter.jsl.TelnetEcho ;params = 7 ;param00 = -cp ;param01 = c:\java\test\jsl_0_9_9g\src ;param02 = -Dcom.sun.management.jmxremote ;param03 = -Dcom.sun.management.jmxremote.port=9696 ;param04 = -Dcom.sun.management.jmxremote.authenticate=false ;param05 = -Dcom.sun.management.jmxremote.ssl=false ;param06 = com.roeschter.jsl.TelnetEcho cmdline = -cp %P1%\jsl_0_9_9h\src com.roeschter.jsl.TelnetEcho ;The below entry method still works but the above is more convenient, ;unless of course you are generating this file programatically ;in which case its the other way round. params = 3 param00 = -cp param01 = %P1%\jsl_0_9_9g\src param02 = com.roeschter.jsl.TelnetEcho