org.databene.benerator.consumer
Class BadDataConsumer

java.lang.Object
  extended by org.databene.benerator.consumer.ConsumerProxy
      extended by org.databene.benerator.consumer.BadDataConsumer
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, Consumer, org.databene.commons.ThreadAware

public class BadDataConsumer
extends ConsumerProxy

Consumer proxy that forwards data to 'real consumer' and if the real consumer raises an error, forwards the data to a 'bad data consumer'.

Created: 23.01.2011 08:04:17

Since:
0.6.4
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.consumer.ConsumerProxy
target
 
Constructor Summary
BadDataConsumer(Consumer badDataTarget, Consumer realTarget)
           
 
Method Summary
 void close()
          When called, the implementor has to close and free all resources.
 void flush()
          Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far.
 void startConsuming(ProductWrapper<?> wrapper)
          Starts consumption of an object.
 
Methods inherited from class org.databene.benerator.consumer.ConsumerProxy
finishConsuming, getTarget, isParallelizable, isThreadSafe, setTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BadDataConsumer

public BadDataConsumer(Consumer badDataTarget,
                       Consumer realTarget)
Method Detail

startConsuming

public void startConsuming(ProductWrapper<?> wrapper)
Description copied from interface: Consumer
Starts consumption of an object. For invocation details see the class documentation.

Specified by:
startConsuming in interface Consumer
Overrides:
startConsuming in class ConsumerProxy

flush

public void flush()
Description copied from interface: Consumer
Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far. In Benerator descriptor files, the flushing behavior is controlled by the pageSize attribute.

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in interface Consumer
Overrides:
flush in class ConsumerProxy

close

public void close()
Description copied from interface: Consumer
When called, the implementor has to close and free all resources. It will not receive any more calls.

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface Consumer
Overrides:
close in class ConsumerProxy


Copyright © 2013. All Rights Reserved.