Please or
Try NowBuy Now

Locations of visitors to this page

SourceForge.net

SourceForge.JP

wrapper.filter.<x>.<n> Properties
wrapper.filter.<x>.<n> Properties

Configuration Property Overview

wrapper.filter.trigger.<n> and wrapper.filter.action.<n>

Compatibility :3.0.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

A pair of wrapper.filter.trigger.<n> and wrapper.filter.action.<n> properties make it possible to filter the output of a JVM, and then perform some action whenever a specific trigger string is found. The filtering process works by comparing JVM console output against registered triggers until a match is found. At that point, the associated action is executed. Only the first matching trigger will be handled for any line of output. In each trigger/action pair, the "<n>" component of the property name is an integer number counting up from "1". By default, there can be no missing numbers. The wrapper.ignore_sequence_gaps property can optionally be set to allow gaps in the sequence.

wrapper.filter.trigger.<n>

The trigger can be any string.

wrapper.filter.action.<n>

If an action is omitted, it will default to RESTART.

Possible actions are:

  • DEBUG (ver. 3.5.0 or later) -

    will cause a debug message to be logged. This is only really useful in helping to understand when the action is fired.

  • DUMP (ver. 3.3.6 or later) -

    will invoke a thread dump.

  • RESTART -

    will stop the current JVM and then restart a new invocation.

  • SHUTDOWN -

    will stop the JVM as well as the Wrapper.

  • USER_<n> (ver. 3.5.0 or later)(Professional Edition) -

    will cause a user defined event to be fired.

  • PAUSE (ver. 3.5.0 or later) -

    will pause the Java application if pausing is enabled and the JVM is running. See the wrapper.pausable property for details.

  • RESUME (ver. 3.5.0 or later) -

    will resume the Java application if it is in a paused state. This could be used if the JVM is not stopped when paused. See the wrapper.pausable property for details.

  • NONE -

    is useful because it will prevent any triggers with a higher number from being triggered.

Usage Examples:

The following example will monitor the JVM output and then restart the JVM automatically whenever a java.lang.OutOfMemoryError is thrown to the console. Depending on where in an application the error is thrown, it is not always possible to trap and handle the error in a useful way from within the JVM.

Filters work by monitoring the console output of the JVM. In order for a trigger to be fired by an exception, the Java application must print the message being filtered to the console.

Example:
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART

The next example demonstrates how to trigger a JVM restart whenever the string Error appears anywhere in the output, with the exception of the case where the string is part of the larger string IgnoreError.

Example:
wrapper.filter.trigger.1=IgnoreError
wrapper.filter.action.1=NONE
wrapper.filter.trigger.2=Error
wrapper.filter.action.2=RESTART

The string being filtered can contain spaces. But due to the way the configuration properties are loaded in general, any leading of trailing spaces will be trimmed when the property is loaded.

Example:
wrapper.filter.trigger.1=Restart me now.
wrapper.filter.action.1=RESTART

More than one actions:

Starting with Wrapper version 3.5.0, it is possible to specify more than one actions by separating them with a space or comma. When more than one action is specified, they will be executed in rapid succession in the order specified.

The following example will perform a thread dump and then restart the JVM in response to a user error message being detected in the console output.

Example:
wrapper.filter.trigger.1=User Error
wrapper.filter.action.1=DUMP,RESTART

wrapper.filter.message.<n>

Compatibility :3.5.0
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :WindowsMac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

The wrapper.filter.message.<n> property can be used to control the message which is displayed to the user when a trigger is fired. This can be very useful to explain the user what is happening. The default value is "Filter trigger matched."

Example:
wrapper.filter.trigger.1=java.lang.OutOfMemoryError
wrapper.filter.action.1=RESTART
wrapper.filter.message.1=The JVM has run out of memory.




User Comments

If you notice something that is incorrect, missing, or simply feel that some part of this page could be explained better, feel free to log in and add a comment. You will need to register before you can log on.

Email:
Password:
Java Service Wrapper Version: 3.5.4