public abstract class DataWriter extends DataEndpoint
writeImpl(Record)
,
however, most subclasses will also override DataEndpoint.open()
and DataEndpoint.close()
.DataEndpoint.State
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, log, name, TIMESTAMP_FORMAT
Constructor and Description |
---|
DataWriter() |
Modifier and Type | Method and Description |
---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException . |
int |
available()
Returns the number of records that can probably be written without blocking.
|
DataWriter |
getNestedEndpoint()
Returns the
Endpoint held inside this one or null if there isn't one. |
DataWriter |
getNestedWriter()
Returns the
DataWriter held inside this one or null if there isn't one. |
DataWriter |
getRootEndpoint()
Returns the deepest, nested
Endpoint held inside this one, otherwise this instance is returned if
there aren't any nested Endpoint s. |
DataWriter |
getRootWriter()
Returns the deepest, nested
DataWriter held inside this one, otherwise this instance is returned if
there aren't any nested DataWriter s. |
void |
write(Record record)
Writes the specified record to this
DataWriter and increases the record-count by 1. |
protected abstract void |
writeImpl(Record record)
Overridden by subclasses to write the specified record to this
DataWriter . |
close, decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, open, resetRecordCount, toString
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public DataWriter getNestedEndpoint()
Endpoint
Endpoint
held inside this one or null
if there isn't one.getNestedEndpoint
in class DataEndpoint
public DataWriter getRootEndpoint()
Endpoint
Endpoint
held inside this one, otherwise this instance is returned if
there aren't any nested Endpoint
s.getRootEndpoint
in class DataEndpoint
public DataWriter getNestedWriter()
DataWriter
held inside this one or null
if there isn't one.public DataWriter getRootWriter()
DataWriter
held inside this one, otherwise this instance is returned if
there aren't any nested DataWriter
s.public int available() throws DataException
DataException
protected abstract void writeImpl(Record record) throws Throwable
DataWriter
.Throwable
public void write(Record record) throws DataException
DataWriter
and increases the record-count by 1.
Any exception raised while writing will be converted to a DataException
using DataObject.exception(Throwable)
.
Subclasses generally do not need to override this method, instead they should implement writeImpl(Record)
.
DataException
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class DataEndpoint
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.