Last modified: 18 October 2024
pdrBatcher extendibility
The pdrBatcher provides facilities to extend the application for notifications.
File event handler
The file event handler is a hook enabling execution of custom Java code when file events occur. The process for enabling a file event handler is:
- Create your own Java class extending the pdrFileEventInt interface.
- Compile your class and ensure placing it in a directory visible to the CLASSPATH environment variable in the pdrEnvironment.bat file.
- Add the definition of your class with the batcher_event_class property in the pdrBatcher.properties file.
Potential uses of the handler facility include sending an event message on the successful transfer of data to or from the remote source. Be aware that a poorly-performing event handler can have a significant detrimental effect on overall performance of pdrBatcher.
The definition of the Java interface for the file event handler is:
package au.com.nemmco.Pdr.Batcher;
/** generic interface for trapping file based events */
public interface pdrFileEventInt {
/** event method that is called for successful file download processing */
public void fileProcess(String theFilename);
/** event method that is called for successful file download processing */
public void fileProcessToTarget(String theFilename, String thePath);
}