Please or
Try NowBuy Now
Google

Locations of visitors to this page

Event Configuration Properties
Event Configuration Properties

Configuration Property Overview

Event Configuration Properties

Event Types

The Wrapper is able to send emails and/or execute external commands in response to a number of events. The following list describes each of the defined events:

  • wrapper_start - Fired when the Wrapper process first starts. This event can be used to do any initialization that must be done before the first JVM is launched.

    In the case of emails, it can be used to indicate that the system has just been rebooted, for example.

  • jvm_prelaunch - Fired whenever a new JVM is about to be launched. This event can be used to do any initialization that must be done before the each JVM is launched.

  • jvm_start - Fired immediately after a new JVM has been launched but before its application is started.

  • jvm_started - Fired once the Wrapper code in the JVM has notified the Wrapper process that the new application is up and running.

    Note that unless Integration Method 3 (WrapperListener) is being used, this may be fired before the user application is actually fully up. Depending on the user application, both Method 1 (WrapperSimpleApp) and Method 2 (WrapperStartStopApp) can also be configured to wait until the application is fully started before reporting that it is up. See the "Advanced" section of each Integration Method for details.

  • jvm_stop - Fired whenever a JVM is about to be shutdown. The event will be fired if the JVM crashes but it will happen after the JVM process is gone.

    If the system crashes or loses power for any reason, the event will never be fired.

  • jvm_stopped - Fired after a JVM is shutdown for any reason. This event can be used to do any cleanup.

    If the system crashes or loses power for any reason, the event will never be fired.

  • jvm_restart - Fired when the Wrapper is about to restart a JVM.

  • jvm_failed_invocation - Fired when the JVM has exited in a state which result in a restart but the total time that the JVM was running was less than the configured wrapper.successful_invocation_time.

  • jvm_max_failed_invocations - Fired when the JVM has exited in a state which result in a restart but the total time that the JVM was running was less than the configured wrapper.successful_invocation_time and the total number of consecutive failed invocations is more than the configured wrapper.max_failed_invocations.

  • jvm_kill - Fired when the Wrapper has decided that a JVM which it believed to be frozen needs to be killed. This happens before the JVM process is killed. This event will always be preceded but the jvm_stop event then followed by the jvm_killed and jvm_stopped events.

  • jvm_killed - Fired when the Wrapper has killed a JVM which it believed to be frozen. This event will always be followed by the jvm_stopped event.

  • jvm_unexpected_exit - Fired when the JVM process disappears for an unexpected reason. For example when it crashes. This event will always be followed by the jvm_stop and jvm_stopped events.

  • wrapper_stop - Fired last when the Wrapper process is shutting down. This event can be used to do any cleanup that must be done after the last JVM is shutdown.

    Note that this event will only be fired if the Wrapper is shutdown normally. If the system crashes or loses power for any reason, the event will never be fired.

Event Mails

NOTE

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

The Wrapper is able to send out alert emails to in response to certain events. See the documentation of individual properties for details on their use.

Example (send email in response to JVM restarts):
# Common Event Email settings.
#wrapper.event.default.email.debug=TRUE
wrapper.event.default.email.smtp.host=smtp.mycompany.com
wrapper.event.default.email.smtp.port=25
wrapper.event.default.email.subject=[%WRAPPER_HOSTNAME%:%WRAPPER_NAME%:%WRAPPER_EVENT_NAME%] Event Notification
wrapper.event.default.email.sender=myapp-noreply@mycompany.com
wrapper.event.default.email.recipient=myapp-admin@mycompany.com

# Event specific settings.
wrapper.event.jvm_restart.email=TRUE
wrapper.event.jvm_restart.email.body=The JVM was restarted.\n\nPlease check on its status.\n

The properties are all of the form wrapper.event.<x>.email* where x is one of the Event Types defined above or the keyword default.

Whenever a property is not specifically defined for any of the event names, the default value will be used. This is useful for setting values which will be common to all event emails.

Event Commands

NOTE

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

The Wrapper is able to execute external commands in response to certain events. See the documentation of individual properties for details on their use.

It is possible to instruct the Wrapper to launch the command and forget it, block until the command has completed, or wait a maximum time for the command to complete. If the wait times out, the command will be left running.

The Wrapper does not currently provide for a way to log the output of the external commands.

Example (execute 'mycleanup' before JVM launch, no wait):
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2=parameter1
Example (execute 'mycleanup' before JVM launch, indefinite wait):
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2=parameter1
wrapper.event.jvm_prelaunch.command.block=TRUE
Example (execute 'mycleanup' before JVM launch, 5 second wait):
wrapper.event.jvm_prelaunch.command.argv.1=/usr/bin/mycleanup
wrapper.event.jvm_prelaunch.command.argv.2=parameter1
wrapper.event.jvm_prelaunch.command.block=TRUE
wrapper.event.jvm_prelaunch.command.block.timeout=5

The properties are all of the form wrapper.event.<x>.command.* where x is one of the Event Types defined above.





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