Your application may require to run scheduled tasks or perform actions at specific times or at regular intervals. For example:
- It is suffering from a memory leak which requires the JVM to be restarted at least once per week.
- It needs to be restarted during a time when the system is not used, at times when system administrators are home in bed.
- It needs to be taken down for 10 minutes every night to allow external backups to take place.
- You may simply want to schedule some benign actions to take place once every 5 minutes.
Here we tell you how you can do all this with the Java Service Wrapper.
Solution |
The Java Service Wrapper provides a way to schedule tasks such as restarts, shutdowns, thread dumps, custom events, etc. in a cross platform way using the Wrapper's timer functionality. Timers are defined within the Wrapper's configuration file, making it possible to reliably contain all such settings within the application themselves. This makes it easy to deploy the application to multiple servers and know that everything will work consistently. Timers can be scheduled for specific times and days of the week, or at intervals ranging from once per week down to every second. This flexibility makes it easy to plan backups or downtimes at times which least inconvenience your users. It also allows your system administrators to reduce overtime by working regular hours. |
Technical Overview |
||||||||||||||||||||||||||||||||||||||||||||||||||||
The Wrapper allows you to define multiple timers, each using a pair of properties.
The first property, wrapper.
Property: wrapper.
The property wrapper.
Property: wrapper.
The property wrapper.
Setting multiple timers: If you want to declare multiple timers, simply add additional properties with unique numbers in place of the 1 above.
We will now cover some interesting uses of timers with your applications.
|
Reference: Property Configurations |
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.
|