org.databene.benerator.consumer
Class ConsumerProxy

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

public abstract class ConsumerProxy
extends java.lang.Object
implements Consumer, org.databene.commons.ThreadAware

Parent class for Consumers that serve as proxy to other Consumers.

Created: 22.10.2009 16:18:07

Since:
0.6.0
Author:
Volker Bergmann

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

Field Detail

target

protected Consumer target
Constructor Detail

ConsumerProxy

public ConsumerProxy(Consumer target)
Method Detail

isThreadSafe

public boolean isThreadSafe()
Specified by:
isThreadSafe in interface org.databene.commons.ThreadAware

isParallelizable

public boolean isParallelizable()
Specified by:
isParallelizable in interface org.databene.commons.ThreadAware

getTarget

public Consumer getTarget()

setTarget

public void setTarget(Consumer target)

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

finishConsuming

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

Specified by:
finishConsuming in interface Consumer

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

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


Copyright © 2013. All Rights Reserved.