|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataReader
com.northconcepts.datapipeline.core.ProxyReader
com.northconcepts.datapipeline.core.AsyncReader
public class AsyncReader
A proxy that reads data asynchronously using a separate thread.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
DataEndpoint.State |
| Field Summary | |
|---|---|
static int |
MINIMUM_BUFFER_SIZE
|
| Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
BUFFER_SIZE, log |
| Constructor Summary | |
|---|---|
AsyncReader(DataReader reader)
|
|
| Method Summary | |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a DataException. |
int |
available()
Returns the number of records that can probably be read without blocking. |
void |
close()
Indicates that this endpoint has finished reading or writing. |
long |
getBufferSizeInBytes()
|
DataException |
getException()
|
int |
getId()
|
long |
getMaxBufferSizeInBytes()
|
String |
getName()
|
long |
getPeakBufferSizeInBytes()
|
int |
getPriority()
|
void |
open()
Makes this endpoint ready for reading or writing. |
protected Record |
pop()
Removes and returns the next record in this DataReaders buffer or null if it is empty. |
void |
push(Record record)
Adds a record to this DataReaders buffer. |
protected Record |
readImpl()
Overridden by subclasses to read the next record from this DataReader. |
AsyncReader |
setMaxBufferSizeInBytes(long maxBufferSize)
|
AsyncReader |
setPriority(int priority)
|
String |
toString()
|
| Methods inherited from class com.northconcepts.datapipeline.core.ProxyReader |
|---|
getNestedReader, interceptRecord, setNestedDataReader, setNestedDataReader |
| Methods inherited from class com.northconcepts.datapipeline.core.DataReader |
|---|
getBufferSize, getRootReader, peek, read, skip |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MINIMUM_BUFFER_SIZE
| Constructor Detail |
|---|
public AsyncReader(DataReader reader)
| Method Detail |
|---|
public long getMaxBufferSizeInBytes()
public AsyncReader setMaxBufferSizeInBytes(long maxBufferSize)
public long getBufferSizeInBytes()
public long getPeakBufferSizeInBytes()
public int getPriority()
public AsyncReader setPriority(int priority)
public DataException getException()
public int getId()
public String getName()
public String toString()
toString in class DataEndpoint
public void open()
throws DataException
DataEndpoint
open in class ProxyReaderDataException
public void close()
throws DataException
DataEndpoint
close in class ProxyReaderDataExceptionpublic void push(Record record)
DataReaderDataReaders buffer. Records in the buffer will be returned
by DataReader.read() before attempting to read from the underlying implementation.
push in class DataReaderDataReader.read()protected Record pop()
DataReaderDataReaders buffer or null if it is empty.
pop in class DataReaderDataReader.push(Record)
public int available()
throws DataException
DataReader
available in class ProxyReaderDataException
protected Record readImpl()
throws Throwable
DataReaderDataReader.
If no record is available, null will be returned.
readImpl in class ProxyReaderThrowablepublic DataException addExceptionProperties(DataException exception)
DataEndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.
addExceptionProperties in class ProxyReader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||