public abstract class AbstractWire extends Object implements Wire
WireIn.HeaderTypeMarshallableOut.Padding| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
ASSERTIONS |
protected net.openhft.chronicle.bytes.Bytes<?> |
bytes |
protected net.openhft.chronicle.core.pool.ClassLookup |
classLookup |
protected Object |
parent |
protected boolean |
use8bit |
MARSHALLABLE_IN_INTERN_SIZEDEFAULT_SAFE_LENGTH, TRY_WRITE_HEADER_FAILED| Constructor and Description |
|---|
AbstractWire(net.openhft.chronicle.bytes.Bytes bytes,
boolean use8bit) |
| Modifier and Type | Method and Description |
|---|---|
net.openhft.chronicle.bytes.Bytes<?> |
bytes() |
net.openhft.chronicle.bytes.BytesComment<?> |
bytesComment() |
net.openhft.chronicle.core.pool.ClassLookup |
classLookup() |
void |
classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
Define how classes should be looked up.
|
void |
clear()
reset the state of the current wire for reuse.
|
boolean |
endUse()
Check the Wire was not used by another thread.
|
long |
enterHeader(int safeLength) |
void |
forceNotInsideHeader()
used by write bytes when doing a rollback
|
long |
headerNumber() |
Wire |
headerNumber(long headerNumber) |
void |
headNumberCheck(HeadNumberChecker headNumberChecker) |
boolean |
isInsideHeader() |
boolean |
notCompleteIsNotPresent()
If a message is marked as NOT_COMPLETE is it still present.
|
void |
notCompleteIsNotPresent(boolean notCompleteIsNotPresent) |
ObjectInput |
objectInput() |
ObjectOutput |
objectOutput() |
Object |
parent()
Obtain the parent class of this wire if there is one
|
void |
parent(Object parent)
Assign a parent object to this wire for later retrieval.
|
net.openhft.chronicle.threads.Pauser |
pauser() |
void |
pauser(net.openhft.chronicle.threads.Pauser pauser) |
void |
readAndSetLength(long position) |
WireIn.HeaderType |
readDataHeader(boolean includeMetaData) |
long |
readEventNumber() |
void |
readFirstHeader() |
void |
readFirstHeader(long timeout,
TimeUnit timeUnit) |
void |
readMetaDataHeader() |
boolean |
startUse()
Used to check that the wire is being used by only one thread
|
void |
updateFirstHeader()
update the first header after writing.
|
void |
updateHeader(long position,
boolean metaData,
int expectedHeader) |
void |
writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
Write the end of wire marker, unless one is already written.
|
boolean |
writeFirstHeader()
Start the first header, if there is none This will increment the headerNumber as appropriate
if successful
|
long |
writeHeaderOfUnknownLength(int safeLength,
long timeout,
TimeUnit timeUnit,
net.openhft.chronicle.core.values.LongValue lastPosition,
Sequence sequence)
Write a message of unknown length, handling timeouts and the end of wire marker.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasText, consumePadding, copyTo, getValueIn, hasMore, isEmpty, isNotEmptyAfterPadding, rawReadData, read, read, read, read, readAlignTo, readAllAsMap, readComment, readDataHeader, readDocument, readDocument, readEvent, readEventName, readingDocument, readingDocument, readingPeekYamlmethodReader, methodReaderBuilder, peekDocument, readBytes, readBytes, readDocument, readMap, readText, readTextaddPadding, dropDefault, endEvent, getValueOut, padToCacheAlign, startEvent, updateHeader, write, write, write, writeAlignTo, writeAllAsMap, writeComment, writeDocument, writeEvent, writeEventId, writeEventName, writeEventName, writeHeader, writeHeaderOfUnknownLength, writeNotCompleteDocument, writingDocument, writingDocumentisTextWire, newBooleanReference, newIntReference, newLongArrayReference, newLongReference, newTwoLongReferencemethodWriter, methodWriter, methodWriterBuilder, padToCacheAlignMode, recordHistory, writeBytes, writeDocument, writeDocument, writeMap, writeMessage, writeTextprotected static final boolean ASSERTIONS
@NotNull protected final net.openhft.chronicle.bytes.Bytes<?> bytes
protected final boolean use8bit
protected net.openhft.chronicle.core.pool.ClassLookup classLookup
protected Object parent
public AbstractWire(@NotNull
net.openhft.chronicle.bytes.Bytes bytes,
boolean use8bit)
public boolean isInsideHeader()
public net.openhft.chronicle.threads.Pauser pauser()
pauser in interface WireCommonpublic void pauser(net.openhft.chronicle.threads.Pauser pauser)
pauser in interface WireCommonpauser - to use for blocking operations.public void clear()
WireCommon@NotNull public Wire headerNumber(long headerNumber)
headerNumber in interface WireheaderNumber in interface WireCommonpublic void headNumberCheck(HeadNumberChecker headNumberChecker)
public long headerNumber()
headerNumber in interface WireCommonpublic void classLookup(net.openhft.chronicle.core.pool.ClassLookup classLookup)
WireCommonclassLookup in interface WireCommonclassLookup - to usepublic net.openhft.chronicle.core.pool.ClassLookup classLookup()
classLookup in interface WireCommon@NotNull public net.openhft.chronicle.bytes.Bytes<?> bytes()
bytes in interface WireCommonpublic net.openhft.chronicle.bytes.BytesComment<?> bytesComment()
bytesComment in interface WireCommon@NotNull public WireIn.HeaderType readDataHeader(boolean includeMetaData) throws EOFException
readDataHeader in interface WireInEOFExceptionpublic void readAndSetLength(long position)
readAndSetLength in interface WireInpublic void readMetaDataHeader()
readMetaDataHeader in interface WireInpublic void readFirstHeader()
throws StreamCorruptedException
readFirstHeader in interface WireInStreamCorruptedExceptionpublic void readFirstHeader(long timeout,
TimeUnit timeUnit)
throws TimeoutException,
StreamCorruptedException
readFirstHeader in interface WireInTimeoutExceptionStreamCorruptedExceptionpublic long writeHeaderOfUnknownLength(int safeLength,
long timeout,
TimeUnit timeUnit,
@Nullable
net.openhft.chronicle.core.values.LongValue lastPosition,
Sequence sequence)
throws TimeoutException,
EOFException
WireOutwriteHeaderOfUnknownLength in interface WireOuttimeout - throw a TimeoutException if the header could not be written in this
time.timeUnit - of the timeOutlastPosition - the last known positionTimeoutException - the underlying pauser timed out.EOFException - the end of wire marker was reached.public long enterHeader(int safeLength)
enterHeader in interface WireOutpublic void updateHeader(long position,
boolean metaData,
int expectedHeader)
throws StreamCorruptedException
updateHeader in interface WireOutStreamCorruptedExceptionpublic boolean writeFirstHeader()
WireOutNote: the file might contain other data and the caller has to check this.
writeFirstHeader in interface WireOutpublic void updateFirstHeader()
WireOutupdateFirstHeader in interface WireOutpublic void writeEndOfWire(long timeout,
TimeUnit timeUnit,
long lastPosition)
WireOutwriteEndOfWire in interface WireOuttimeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutlastPosition - the end of the wirepublic Object parent()
WireCommonparent in interface WireCommonpublic void parent(Object parent)
WireCommonparent in interface WireCommonparent - to set, or null if there isn't one.public boolean startUse()
WireCommonstartUse in interface WireCommonpublic boolean endUse()
WireCommonendUse in interface WireCommonpublic boolean notCompleteIsNotPresent()
WireCommonnotCompleteIsNotPresent in interface WireCommonpublic void notCompleteIsNotPresent(boolean notCompleteIsNotPresent)
notCompleteIsNotPresent in interface WireCommonpublic ObjectOutput objectOutput()
objectOutput in interface WireOutpublic ObjectInput objectInput()
objectInput in interface WireInpublic long readEventNumber()
readEventNumber in interface WireInpublic void forceNotInsideHeader()
Copyright © 2019. All rights reserved.