pdrLoader extendability

The pdrLoader provides facilities to extend the application for notification and customised transforms.

File event handler

The file event handler is a hook enabling execution of custom code when file events occur. The process for enabling a file event handler is:

  1. Create your own Java class extending the pdrFileEventInt interface.
  2. Compile your class and ensure placing it in a directory visible to the CLASSPATH environment variable in the pdrEnvironment.bat file.
  3. Add the definition of your class with the file_load_event_class property in the pdrLoader.properties file.

In the case of using the pdrLoader extensibility functionality within a Windows service environment, the following additional configuration steps are required:

  1. Modify the WinRun4J.ini file to include additional CLASSPATH entries if required. If the code is located in a directory other than the Lib directory, then additional CLASSPATH directory references will need to be created. These directory references are relative to the Lib directory.

As an example, if there was a plugin directory created at the same level as the Lib directory in the pdrLoader installation directories, with JAR files contained in the plugin and plugin/lib directory and other resources (e.g. a configuration file) located in a directory plugin/config, the additional CLASSPATH entries would be defined as classpath.3, classpath.4 and classpath.5 below.

classpath.1=*.jar

classpath.2=.

classpath.3=./../plugin/*.jar

classpath.4=./../plugin/lib/*.jar

classpath.5=./../plugin/config

  1. If the Windows service is already installed, un-install the windows service using instructions contained in Using NT database authenticationPage 1.
  2. Re-install the Windows service, see Using NT database authenticationPage 1.

Potential uses of the handler facility include sending an event message on the arrival of data and providing a customised alarming capability in the event of a failure to load a file.

The definition of the Java interface for the file event handler is:

package au.com.nemmco.Pdr.Loader;

/** generic interface for trapping file based events */

public abstract class pdrFileEventInt {

    /** event method fired at the start of file processing */

    public abstract void fileProcessStart(long thePdrReportId, String theFilename, String theReportType);

    /** event method called for successful file processing */

    public abstract void fileProcessSuccess(long thePdrReportId, String theFilename, String theReportType, int theNoRows);

    /** event method called for successful file processing */

    public abstract void fileProcessFailed(long thePdrReportId, String theFilename, String theReportType, String theErrorMessage);

}