|
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.
|
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 - 7 where 1 is Sunday and 7 is 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",
or the same as a value list of "0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55".
-
Value list : -
A value like 5, 30, 45 is used to specify
a specific set of values.
|
NOTE
|  |
NOTE - This Value List method has not yet been implemented as of this writing.
In the mean time, multiple timers can be defined instead of this functionality.
|
|