The Wrapper distribution also includes an alternative batch file
which functions very much like the shell script that is provided
with UNIX versions of the Wrapper. This script requires a single
command argument, which tells the script what to do. It has the
benefit of being able to do everything from a single batch file.
But the drawback of not being able to simply double-click on the
batch file from the File Manager.
To make use of this script, simply copy the following file to your
application's bin directory.
{WRAPPER_HOME}\src\bin\AppCommand.bat.in
|
Rename the script as follows, replacing "MyApp" throughout this
document with the name of your application.
Be sure to remove the .in
extensions so that the file ends in
.bat. Depending on how
your file explorer is configured, you may not be able to see
the extension.
To familiarize yourself with the script, run it without any
arguments. You will see the following:
C:\MyApp\bin>MyApp.bat
Usage: MyApp.bat { console : start : stop : restart : install : remove }
Press any key to continue . . .
|
The console command runs the
Wrapper in the current command window. The
start and stop
commands are used to start and stop the Wrapper when it is installed
as an NT service. The restart
command will stop and then immediately start the Wrapper. And the
install and remove
commands are used to install and remove the Wrapper as an NT service.
There are a few differences between this script and the UNIX script.
The UNIX script can be used to stop a copy of the Wrapper running in
a console. This is not possible with the Windows script. In addition,
the dump command is missing from
the Windows version of the script.
As an example, the Wrapper can be started in a console using the
following command:
C:\MyApp\bin>MyApp.bat console
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.x.x)
jvm 1 |
|
To execute other commands, simply replace console
with the command you wish to have executed.
|