Real Time Information Director User Documentation
RTID Message Format and Programmatic Interfaces
Hewlett-Packard Company 17 529618 - 002
dispatcher.dispatch(inputStream);
If you prefer to use strings for input and output, use the following syntax:
Dispatcher.dispatch(inputString, outputString);
5. Catch any exceptions, and perform any suitable processing:
Catch (Exception e) {
Systen.out.println(“Error calling dispatch” + e);
…
}
6. Use the freeResources method to release the Dispatcher. For example:
dispatcher.freeResources();
If you would prefer for your program to accept filenames as arguments, you can set up
streams as in the following example:
/** dispatches a file and saves response in output directory
*/
protected void processFile(String inputFilename, String
outputFilename)
{
try{
// setup input & output streams
FileInputStream inputStream = new
FileInputStream(inputFilename);
FileOutputStream outputStream = new
FileOutputStream(outputFilename);
dispatcher.dispatch(inputStream,outputStream);
inputStream.close();
outputStream.close();
}catch(Exception e){
…
}
}
Invoking the Director with the Low-level Interface
The low-level interface is defined to support batch applications and others that do not use
XML documents for input and output. Instead of XML, the low-level interface operates
directly on the Group object that represents a document within the Director.
The low-level interface consists of the following major classes: