Please or
Try NowBuy Now
Google

Locations of visitors to this page

wrapper.timer.<n>.<x> Properties
wrapper.timer.<n>.<x> Properties

Configuration Property Overview

wrapper.timer.<n>.<x>

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

WARNING

DO NOT modify any of these parameters unless you have read this property description. Incorrect settings can cause the Wrapper to fail to operate as expected.

NOTE

This function requires the Professional Edition of the Java Service Wrapper.

The timer properties make it possible to schedule JVM restarts, shutdowns, or thread dumps at specific times or intervals in a cron-job like fashion. This can be useful in cases where the user application leaks memory or has other requirements which require periodic restarts.

The following example will restart the JVM every day at exactly 4am.

Example:
wrapper.timer.1.action=RESTART
wrapper.timer.1.interval=hour=4

Each timer declaration consists of two properties. The wrapper.timer.<n>.action and wrapper.timer.<n>.interval properties. 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.timer.<n>.action property:

Timer actions can have the following values:

  • DEBUG - Each time the timer is fired, a debug message will be logged. This is only really useful in helping to understand how the timers work.

  • DUMP - Requests that the JVM perform a thread dump each time the timer is fired. This can be useful to track down memory or performance problems when you are not sure exactly when they are taking place. Make sure your logging properties have been set up to handle large log files if you set the interval to a high rate.

  • NONE - This effectively disables the timer. It can be useful to disable a timer rather than deleting it to avoid having to renumber successive timers.

  • RESTART - The Java application will be restarted each time the timer is fired.

  • SHUTDOWN - The Wrapper will be shutdown when the timer is fired. This can obviously only happen once unless the Wrapper is being relaunched externally.

wrapper.timer.<n>.interval property:

Timer intervals can be built up using a combination of tokens. For example, the following example will restart the JVM every second day at 04:30:10:

Example:
wrapper.timer.1.action=RESTART
wrapper.timer.1.interval=day-of-week=*/2; hour=4; minute=30; second=10

Interval tokens can have the following values:

  • day-of-week - Specifies the day of the week. Acceptable values in the range 1 (Sunday) - 7 (Saturday).

  • hour - Specifies the hour of the day. Acceptable values in the range 0 - 23.

  • minute - Specifies the minute. Acceptable values in the range 0 - 59.

  • second - Specifies the second. Acceptable values in the range 0 - 59.

In most cases, not all possible tokens will be specified in an interval declaration. When tokens are omitted, larger tokens will get a default value of *. Smaller tokens will be set to the minimum token value.

These declarations are identical:
wrapper.timer.1.interval=hour=4
wrapper.timer.1.interval=hour=4; minute=0; second=0
wrapper.timer.1.interval=day-of-week=*; hour=4
wrapper.timer.1.interval=day-of-week=*; hour=4; minute=0; second=0

Token values can have the following formats:

  • Absolute value : - A value like 5 is used to specify a single value.

  • All values : - A value like * is used to specify all possible values for the token as well as a wildcard character.

  • Value interval : - A value like */5 is used to specify a set of values at regular intervals starting with the minimum possible value for the token. So the value */5 for the minute token would define a value "every 5 minutes".





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.4.0