public abstract class AbstractWire extends Object implements Wire
WireIn.HeaderType| 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 |
| Constructor and Description |
|---|
AbstractWire(net.openhft.chronicle.bytes.Bytes bytes,
boolean use8bit) |
| Modifier and Type | Method and Description |
|---|---|
net.openhft.chronicle.bytes.Bytes<?> |
bytes() |
protected void |
checkNoDataAfterEnd(long pos) |
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.
|
boolean |
hasMore() |
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) |
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(int length,
long position,
boolean metaData)
Change the header from NOT_COMPLETE | length to metaData * META_DATA | length.
|
void |
writeEndOfWire(long timeout,
TimeUnit timeUnit)
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 |
writeHeader(int length,
long timeout,
TimeUnit timeUnit,
net.openhft.chronicle.core.values.LongValue lastPosition)
Write a message of a known length, handling timeouts and the end of wire marker.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasText, consumePadding, copyTo, getValueIn, rawReadData, read, read, read, read, readAlignTo, readAllAsMap, readComment, readDataHeader, readDocument, readDocument, readEvent, readEventName, readingDocument, readingDocumentaddPadding, endEvent, getValueOut, padToCacheAlign, startEvent, updateHeader, write, write, write, writeAlignTo, writeAllAsMap, writeComment, writeDocument, writeEvent, writeEventName, writeEventName, writeHeader, writeNotCompleteDocument, writingDocumentnewIntReference, newLongArrayReference, newLongReferenceprotected static final boolean ASSERTIONS
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()
WireCommonpublic 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 boolean hasMore()
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(long timeout,
TimeUnit timeUnit)
throws TimeoutException,
StreamCorruptedException
readFirstHeader in interface WireInTimeoutExceptionStreamCorruptedExceptionpublic long writeHeader(int length,
long timeout,
TimeUnit timeUnit,
@Nullable
net.openhft.chronicle.core.values.LongValue lastPosition)
throws TimeoutException,
EOFException
WireOutwriteHeader in interface WireOutlength - the maximum length of the message.timeout - throw a TimeoutException if the header could not be written in this
time.timeUnit - of the timeOutTimeoutException - the underlying pauser timed out.EOFException - the end of wire marker was reached.public void updateHeader(int length,
long position,
boolean metaData)
throws StreamCorruptedException
WireOutupdateHeader in interface WireOutlength - provided to make the header, note this can be larger than the message
actually used.position - returned by writeHeadermetaData - whether the message is meta data or not.StreamCorruptedExceptionprotected void checkNoDataAfterEnd(long pos)
public 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)
throws TimeoutException
WireOutwriteEndOfWire in interface WireOuttimeout - throw TimeoutException if it could not write the marker in time.timeUnit - of the timeoutTimeoutException - timeout exceeded.public 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 WireInCopyright © 2016. All rights reserved.