com.northconcepts.datapipeline.meter
Class MeteredWriter

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataWriter
          extended by com.northconcepts.datapipeline.core.ProxyWriter
              extended by com.northconcepts.datapipeline.meter.MeteredWriter
All Implemented Interfaces:
Metered
Direct Known Subclasses:
ThrottledWriter

public class MeteredWriter
extends ProxyWriter
implements Metered

A proxy that measures the rate (bytes/second) at which data is written.


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
MeteredWriter(DataWriter writer)
           
 
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.
 Meter getMeter()
           
protected  Record interceptRecord(Record record)
           
 
Methods inherited from class com.northconcepts.datapipeline.core.ProxyWriter
getNestedWriter, open, setNestedDataWriter, setNestedDataWriter, writeImpl
 
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

MeteredWriter

public MeteredWriter(DataWriter writer)
Method Detail

getMeter

public Meter getMeter()
Specified by:
getMeter in interface Metered

interceptRecord

protected Record interceptRecord(Record record)
                          throws Throwable
Overrides:
interceptRecord in class ProxyWriter
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 ProxyWriter

close

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

Overrides:
close in class ProxyWriter
Throws:
DataException


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