Debugging Event Handlers

Host Integrator includes a variety of options for testing an event handler.

Debugging Event Objects

When you develop an event handler, you can use Host Integrator debugging options to confirm that the handler is returning the results you expect. The event handler examples demonstrate these options.

General Debugging Options

The Validator confirms that libraries associated with event handlers are up to date.

The Event Handler Console displays the output that event handlers send to the Java system output stream.

You can modify the following properties in properties files:

See the guidelines on limiting use of output streams.

Remote Java debugging

If the debugging port on the Java virtual machine that hosts the script manager is enabled, you can use your Java IDE's remote debugging features to set breakpoints, step through code, and view runtime status. The debug port is opened by default in the Design Tool, but must be enabled in the configuration before startup (or restart) in the Session Server. You can review the debugging port setting for the Design Tool on the event handler settings Debugging tab; review a Session Server's assigned event handler debug port in the Administrative WebStation.

Event Handler Timeouts

Event handler timeouts can be disabled in both the Session Server and the Design Tool. When event handler timeouts are disabled, all timers used to calculate timeouts (for a single session) are suspended whenever that session has fired an event to the script manager. Once the script manager returns a response to the Design Tool or Session Server, the suspended timers will resume.

Testing event handler timeouts

Use these steps to test event handler timeouts.

  1. Place a breakpoint in the event handler code activated by an event.
  2. Leave event handler timeouts enabled.
  3. Set the event handler timeout and client timeouts to a value larger than the time expected for the event handler activity.
  4. Cause the event to fire and stop execution at the breakpoint.
  5. Use the Cancel button while the event is in progress to force a timeout exception to be sent to the event handler.
  6. Begin single-stepping through the event handler code to determine how the event handler reacts to the timeout.