wrapper.event.<event_name>.command.argv.<n>

Compatibility :3.3.0
Editions :Professional EditionStandard Edition (Not Supported)Community Edition (Not Supported)
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/Linux

This property is used to specify the arguments of a command executed in response to a specific event.

Like several of the event command properties, it can be defined:

  • Globally for all events: wrapper.event.default.command.argv.<n> property, or
  • For a specific event: wrapper.event.<event_name>.command.argv.<n> property.

The "<event_name>" component of the property name can be either the keyword "default", or one of the Event Types. The "<n>" component of the property name is an integer number counting up from "1". The wrapper.ignore_sequence_gaps property can optionally be set to allow gaps in the sequence.

NOTE

Use of the "default" keyword was added in Wrapper version 3.5.5.


event.default.command:

It is not possible specify default values for individual elements of a command. The Wrapper will first look for a wrapper.event.<event_name>.command.argv.1. If found, it will then only look for the command elements containing the <event_name>. If it was not found, then Wrapper will look for the wrapper.event.default.command.argv.1 property. Finding that, it will then look for the remainder of the command using the default event properties.

Note that defining a "default event command" will cause the command to be executed for every single Wrapper event, including user-defined events.

Example:
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2=/tmp/myapp-tmp

Please see the Event Commands documentation for more examples and an explanation of how the various event properties can be used together.


Event Handler Variables:

When the Wrapper is generating the command line to execute the child process, the Event Handler Variables will be replaced in the value.

Example:
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2=/tmp/myapp-tmp-%WRAPPER_EVENT_JVM_PID%

Problems?

Whenever any problems are found while trying to configure an event command, it can be very useful to enable debugging to help figure out exactly what is happening.

Example:
wrapper.event.default.command.loglevel=INFO

Quotes

Version 3.6.0 and later

Starting with version 3.6.0, the handling of special characters has changed to ensure consistency across all platforms. In most cases, you can write the parameter value exactly as you intend it to be received by the Java application.

An exception to this is leading or trailing spaces, which are normally trimmed from property values. To preserve these spaces, it is necessary to enclose the value in quotation marks. These quotation marks will be stripped if the corresponding "quotable" property is set to TRUE. To retain actual quotes in the value, escape them with a '\' character. Backslashes must also be doubled ('\\'). No other characters are allowed to be escaped.

When stripping quotes, only the the following changes will apply:

  • '\\' will become '\',
  • '\"' will become '"'
  • '"' will become ''
Example:
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2="Argument with trailing spaces  "
wrapper.event.jvm_prelaunch.command.argv.2.quotable=TRUE

Prior to version 3.6.0

In older versions of the Wrapper, the way quotes are handled varies between platforms. On Windows, the Java process is created using a command line where arguments containing spaces must be quoted. The quotes are automatically stripped from the command line when the process is launched. On Linux, however, an array is used, and arguments are passed directly.

To simulate the Windows behavior and use the same configuration across platforms, it is possible to mark certain parameters with a strip quotes flag (stripquotes property = TRUE). This flag is only used on Unix, and specifies that quotes must be stripped before passing the parameter(s) to the JVM.

When stripping quotes, all other characters except for the following will remain unchanged.

  • '\\' will become '\',
  • '\"' will become '"'
  • '"' will become ''

Reference: Event Commands

The Java Service Wrapper provides a full set of configuration properties that allows you to make the Wrapper meet your exact needs. Please take a look at the documentation for the individual properties to see all of the possibilities beyond the examples shown above.