Event Handler Properties Files

Configure the default behavior for event handlers with settings available from the Event Handler Settings dialog box.

You can create other Java properties files for event handler settings. These settings are shared by all models in an installation and control aspects of runtime behavior. Those properties and their values are made available to event handlers via the callback interface method getHandlerProperty(String name) on the event interface passed as the event's parameter.

There are two separate properties files for event handlers: one contains properties for event handlers as they execute within the Design Tool, and the other contains properties for event handlers as they execute with the Host Integrator Session Server. In the <VHI>/etc folder, locate script.properties.sample and dt_script.properties.sample. It is recommended that you copy and rename these files as script.properties and dt_script.properties and modify them to your needs. Additional documentation on settings is also included in the files.

Design Tool Properties: dt_script.properties

Create this file in the <VHI>\etc folder. It can contain settings for the properties described below. This file has the form of a Java properties file. Entries have the form name=value, one per line. Backslashes ( \ ) must be doubled ( \\ ) to be interpreted literally. Open <VHI>/etc/script.properties.sample for details.

Classpath
vhi.script.classpath=<semicolon-separated list of JAR file names>

Design Tool uses the vhi.script.classpath setting to locate Java classes that do not contain event handlers, but which must be available for use with the event handlers used by all models executing on the Server. This file is read at script manager startup. The script manager must be reset (by stopping and restarting it or by closing the Design Tool) before changes made to this file will take effect.

If this file is not present, or if the file does not contain a classpath definition, the classpath is assumed to be empty. No external Java libraries will be available to event handlers unless they are defined here.

Other properties
Any other Java properties contained in this file are made available to event handlers via the Event.getHandlerProperty() API.

Server Properties: script.properties

This file defines properties used by the Session Server to control the script manager. It must be located in the <VHI>\etc folder. This file has the form of a Java properties file. Entries have the form name=value, one per line. Backslashes ( \ ) must be doubled ( \\ ) to be interpreted literally. Open vhi\etc\script.properties.sample for more details.

Classpath
vhi.script.classpath=<list of JAR file names>

The value is a string. On UNIX, it consists of a colon-separated list of JAR file names to be searched. On Windows, it is a semicolon-separated list of JAR file names.

You can define the Java classpath that the Session Server uses for locating Java classes that do not contain event handlers, but that must be available for use with event handlers. This file is read-only when the Server starts. The script manager must be reset (using the Reload Event Handlers option on the Events menu in the Design Tool, or by restarting the Session Server) before changes made to this file take effect.

If this property is not present, the default classpath is assumed to be empty (no external libraries used).

Script Output
Two properties control how event handler data written to the System output (System.out and System.err) is sent.

vhi.script.output.file=true/false
Boolean property that enables or disables script output. The default is false (output disabled).

vhi.script.output.filename=pathname
String that specifies a file in the <VHI>/etc/output directory where System.out and System.err are written. The default filename is handlers.out.

No management is provided for any of the output generated by these properties. Any output recorded is simply appended to whatever content already exists in the output file.

Trap Output
Two properties control how unhandled exceptions caught by the event handler environment will be written to a file.

vhi.script.output.traps=true/false
Enables or disables trap output, recording information about unhandled exceptions. By default, Host Integrator writes stack dumps for unhandled exceptions caught from user classes.

vhi.script.output.trapfile=pathname
String that specifies a file in the vhi/etc/output directory that holds the trap information. The default is traps.out.

No management is provided for any output generated by these properties. Any output recorded is simply appended to whatever content already exists in the output file.

Other Properties
Any other Java properties contained in this file are made available to event handlers via the Event.getHandlerProperty() API.

 

 

 

  Attachmate