public class ProxyWriter extends DataWriter
DataWriter,
possibly transforming them along the way. The only method that a subclass
should implement is interceptRecord(Record).DataEndpoint.StatelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
ProxyWriter(DataWriter nestedDataWriter) |
| 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.
|
void |
close()
Indicates that this endpoint has finished reading or writing.
|
DataWriter |
getNestedWriter()
Returns the
DataWriter held inside this one or null if there isn't one. |
protected Record |
interceptRecord(Record record) |
static ProxyWriter |
map(DataWriter writer,
BiFunction<ProxyWriter,Record,Record> mapper) |
static ProxyWriter |
map(DataWriter Writer,
Function<Record,Record> mapper) |
void |
open()
Makes this endpoint ready for reading or writing.
|
protected void |
setNestedDataWriter(DataWriter nestedDataWriter)
Make sure to close old target and open the new one or call
setNestedDataWriter(DataWriter, boolean) with true. |
protected void |
setNestedDataWriter(DataWriter nestedDataWriter,
boolean manageLifecycle) |
protected void |
writeImpl(Record record)
Overridden by subclasses to write the specified record to this
DataWriter. |
getNestedEndpoint, getRootEndpoint, getRootWriter, getWriter, writedecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount, toStringaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic ProxyWriter(DataWriter nestedDataWriter)
public static ProxyWriter map(DataWriter Writer, Function<Record,Record> mapper) throws Throwable
Throwablepublic static ProxyWriter map(DataWriter writer, BiFunction<ProxyWriter,Record,Record> mapper) throws Throwable
Throwablepublic DataWriter getNestedWriter()
DataWriterDataWriter held inside this one or null if there isn't one.getNestedWriter in class DataWriterprotected void setNestedDataWriter(DataWriter nestedDataWriter)
setNestedDataWriter(DataWriter, boolean) with true.protected void setNestedDataWriter(DataWriter nestedDataWriter, boolean manageLifecycle) throws DataException
DataExceptionpublic int available()
throws DataException
DataWriteravailable in class DataWriterDataExceptionpublic void open()
throws DataException
DataEndpointopen in class DataEndpointDataExceptionpublic void close()
throws DataException
DataEndpointclose in class DataEndpointDataExceptionprotected void writeImpl(Record record) throws Throwable
DataWriterDataWriter.writeImpl in class DataWriterThrowablepublic DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class DataWriterCopyright (c) 2006-2025 North Concepts Inc. All Rights Reserved.