com.northconcepts.datapipeline.core
Class ProxyWriter

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataWriter
          extended by com.northconcepts.datapipeline.core.ProxyWriter
Direct Known Subclasses:
MeteredWriter

public class ProxyWriter
extends DataWriter

Abstract super-class for writing records to another DataWriter, possibly transforming them along the way. The only method that a subclass should implement is interceptRecord(Record).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint
DataEndpoint.State
 
Field Summary
 
Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint
BUFFER_SIZE, log
 
Constructor Summary
ProxyWriter(DataWriter nestedDataWriter)
           
 
Method Summary
 DataException addExceptionProperties(DataException exception)
          Adds this endpoint's current state to a DataException.
 void close()
          Indicates that this endpoint has finished reading or writing.
 DataWriter getNestedWriter()
          Returns the DataWriter held inside this one or null if there isn't one.
protected  Record interceptRecord(Record record)
           
 void open()
          Makes this endpoint ready for reading or writing.
protected  void setNestedDataWriter(DataWriter nestedDataWriter)
          Make sure to close old target and open the new one or call setNestedDataWriter(DataWriter, boolean) with true.
protected  void setNestedDataWriter(DataWriter nestedDataWriter, boolean manageLifecycle)
           
protected  void writeImpl(Record record)
          Overridden by subclasses to write the specified record to this DataWriter.
 
Methods inherited from class com.northconcepts.datapipeline.core.DataWriter
getRootWriter, write
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getDescription, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, setDescription, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxyWriter

public ProxyWriter(DataWriter nestedDataWriter)
Method Detail

getNestedWriter

public DataWriter getNestedWriter()
Description copied from class: DataWriter
Returns the DataWriter held inside this one or null if there isn't one.

Overrides:
getNestedWriter in class DataWriter

setNestedDataWriter

protected void setNestedDataWriter(DataWriter nestedDataWriter)
Make sure to close old target and open the new one or call setNestedDataWriter(DataWriter, boolean) with true.


setNestedDataWriter

protected void setNestedDataWriter(DataWriter nestedDataWriter,
                                   boolean manageLifecycle)
                            throws DataException
Throws:
DataException

open

public void open()
          throws DataException
Description copied from class: DataEndpoint
Makes this endpoint ready for reading or writing.

Overrides:
open in class DataEndpoint
Throws:
DataException

close

public void close()
           throws DataException
Description copied from class: DataEndpoint
Indicates that this endpoint has finished reading or writing.

Overrides:
close in class DataEndpoint
Throws:
DataException

interceptRecord

protected Record interceptRecord(Record record)
                          throws Throwable
Throws:
Throwable

writeImpl

protected void writeImpl(Record record)
                  throws Throwable
Description copied from class: DataWriter
Overridden by subclasses to write the specified record to this DataWriter.

Specified by:
writeImpl in class DataWriter
Throws:
Throwable

addExceptionProperties

public DataException addExceptionProperties(DataException exception)
Description copied from class: DataEndpoint
Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.

Overrides:
addExceptionProperties in class DataWriter


Copyright (c) 2007-2012 North Concepts Inc. All Rights Reserved.