com.northconcepts.datapipeline.meter
Class MeteredReader

java.lang.Object
  extended by com.northconcepts.datapipeline.core.DataEndpoint
      extended by com.northconcepts.datapipeline.core.DataReader
          extended by com.northconcepts.datapipeline.core.ProxyReader
              extended by com.northconcepts.datapipeline.meter.MeteredReader
All Implemented Interfaces:
Metered
Direct Known Subclasses:
ThrottledReader

public class MeteredReader
extends ProxyReader
implements Metered

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


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
MeteredReader(DataReader reader)
           
 
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 readImpl()
          Overridden by subclasses to read the next record from this DataReader.
 
Methods inherited from class com.northconcepts.datapipeline.core.ProxyReader
available, getNestedReader, interceptRecord, open, setNestedDataReader, setNestedDataReader
 
Methods inherited from class com.northconcepts.datapipeline.core.DataReader
getBufferSize, getRootReader, peek, pop, push, read, skip
 
Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MeteredReader

public MeteredReader(DataReader reader)
Method Detail

getMeter

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

readImpl

protected Record readImpl()
                   throws Throwable
Description copied from class: DataReader
Overridden by subclasses to read the next record from this DataReader.

If no record is available, null will be returned.

Overrides:
readImpl in class ProxyReader
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 ProxyReader

close

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

Overrides:
close in class ProxyReader
Throws:
DataException


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