|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.ConfigurableProcessor
de.fu_berlin.ties.CollectingProcessor
public abstract class CollectingProcessor
Abstract base clase for a Processor
that collects
all the input arguments and processes the collected arguments when shutting
down. The close(int)
method delegates to the abstract
process(List, ContextMap)
method to process the collected arguments.
Instances of this class are not thread-safe and must be synchronized externally, if required.
Constructor Summary | |
---|---|
CollectingProcessor(TiesConfiguration conf)
Creates a new instance. |
Method Summary | |
---|---|
void |
close(int errorCount)
Closes this instance, releasing all resources and stopping any background threads. |
abstract void |
process(List<String> collected,
ContextMap context)
Processes the collected input arguments. |
void |
process(String input)
Processes an input argument. |
Methods inherited from class de.fu_berlin.ties.ConfigurableProcessor |
---|
getConfig |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectingProcessor(TiesConfiguration conf)
conf
- used to configure this instance; if null
,
the standard configuration is usedMethod Detail |
---|
public final void close(int errorCount) throws IOException, ProcessingException
close
in interface Closeable
errorCount
- the number of errors (exceptions) that occurred during
calls to this instance (0 if none)
IOException
- if an I/O error occurs
ProcessingException
- if an error occurs during processing any
remaining inputpublic final void process(String input)
process
in interface Processor
input
- the input to processpublic abstract void process(List<String> collected, ContextMap context) throws IOException, ProcessingException
collected
- a list of Strings containing the collected input
argumentscontext
- a map of objects that are made available for processing;
will be empty when called from the close(int)
method in this
class
IOException
- if an I/O error occurs
ProcessingException
- if an error occurs during processing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |