Parsing Engine

danbikel.switchboard
Interface Consumer

All Superinterfaces:
Remote
All Known Implementing Classes:
EventCountsConsumer

public interface Consumer
extends Remote

Specification for a consumer of objects that have already been processed by switchboard clients, allowing arbitrary post-processing in a distributed object-processing run involving a switchboard. It is guaranteed that after each NumberedObject has been processed by some client, every registered consumer's consume(danbikel.switchboard.NumberedObject) method will be called with that numbered object as the argument. A consumer may collect information, write information to the output file or do nothing; the action taken after consumption is implementation-dependent. It is also guaranteed that when the switchboard has determined that the input file contains no more objects to be processed, every registered consumer's processingComplete(java.lang.String, java.lang.String) method will be called. The behavior of a consumer upon invocation of this method is also implementation-dependent.

See Also:
Switchboard.registerConsumer(Consumer)

Method Summary
 void consume(NumberedObject numObj)
          Tells this consumer to consume the specified object that has been processed by one of the switchboard's clients.
 void newFile(String inputFilename, String outputFilename)
          Indicates that the consumer is about to be consuming objects from the specified input file.
 void processingComplete(String inputFilename, String outputFilename)
          Indicates that processing is complete for the specified input/output file pair.
 

Method Detail

newFile

void newFile(String inputFilename,
             String outputFilename)
             throws RemoteException
Indicates that the consumer is about to be consuming objects from the specified input file. The name of the output filename is also a parameter, in case the consumer needs to create an output file when this method is invoked.

Parameters:
inputFilename - the name of the input file for which object processing has commenced
outputFilename - the name of the (optional) output file to be created from the specified input file
Throws:
RemoteException

consume

void consume(NumberedObject numObj)
             throws RemoteException
Tells this consumer to consume the specified object that has been processed by one of the switchboard's clients.

Parameters:
numObj - the processed switchboard object to be consumed by this consumer instance
Throws:
RemoteException

processingComplete

void processingComplete(String inputFilename,
                        String outputFilename)
                        throws RemoteException
Indicates that processing is complete for the specified input/output file pair.

Parameters:
inputFilename - the name of the current input file
outputFilename - the name of the output file
Throws:
RemoteException

Parsing Engine

Author: Dan Bikel.