com.northconcepts.datapipeline.throttle
Class ThrottledReader
java.lang.Object
com.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataReader
com.northconcepts.datapipeline.core.ProxyReader
com.northconcepts.datapipeline.meter.MeteredReader
com.northconcepts.datapipeline.throttle.ThrottledReader
- All Implemented Interfaces:
- Metered, Throttled
public class ThrottledReader
- extends MeteredReader
- implements Throttled
A proxy that limits the rate (bytes/second) at which data is read.
| 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 |
ThrottledReader
public ThrottledReader(DataReader reader,
int bytesPerSecond)
getThrottle
public Throttle getThrottle()
- Specified by:
getThrottle in interface Throttled
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 MeteredReader
- 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 MeteredReader
Copyright (c) 2007-2010 North Concepts Inc. All Rights Reserved.