System.err.println( "usage: pipeline config-file" );
System.exit( -1 );
}
String configFile = args[0];
Digester digester = new Digester();
PluginRules rc = new PluginRules();
digester.setRules( rc );
digester.addObjectCreate( "pipeline", Pipeline.class );
digester.addCallMethod( "pipeline/source", "setSource", 1 );
digester.addCallParam( "pipeline/source", 0, "file" );
PluginCreateRule pcr = new PluginCreateRule( Transform.class );
digester.addRule( "pipeline/transform", pcr );
digester.addSetNext( "pipeline/transform", "setTransform" );
digester.addCallMethod( "pipeline/destination", "setDest", 1 );
digester.addCallParam( "pipeline/destination", 0, "file" );
Pipeline pipeline = null;
try
{
pipeline = digester.parse( configFile );
}
catch ( Exception e )
{
System.err.println( "oops exception occurred during parse." );
e.printStackTrace();