Package org.jctools.channels.proxy
Class ProxyChannelRingBuffer
java.lang.Object
org.jctools.channels.proxy.ProxyChannelRingBuffer
- Direct Known Subclasses:
OffHeapFixedMessageSizeRingBuffer
This is the definition of the API required for the byte code generated by the
ProxyChannelFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract long
consumerReferenceArrayIndex
(long offset) Get the position index of the consumer in the reference arrayprotected abstract long
producerReferenceArrayIndex
(long offset) Get the position index of the producer in the reference arrayprotected abstract long
Acquire an offset to read fromprotected abstract Object
readReference
(long index) Read a reference from the index of the reference array.protected abstract void
readRelease
(long offset) Release the offset from readingprotected abstract long
Acquire an offset to write to.protected abstract void
writeReference
(long index, Object reference) Write a reference into the index of the reference array.protected abstract void
writeRelease
(long offset, int callTypeId) Ordered store of the callTypeId for the message at offset
-
Field Details
-
EOF
public static final long EOF- See Also:
-
-
Constructor Details
-
ProxyChannelRingBuffer
public ProxyChannelRingBuffer()
-
-
Method Details
-
writeAcquire
protected abstract long writeAcquire()Acquire an offset to write to. If there's no space available a wait strategy may be used.- Returns:
- the offset that was acquired for writing or
EOF
-
writeRelease
protected abstract void writeRelease(long offset, int callTypeId) Ordered store of the callTypeId for the message at offset- Parameters:
offset
- the offset that was released for writingcallTypeId
- A unique ID for the call
-
readAcquire
protected abstract long readAcquire()Acquire an offset to read from- Returns:
- the offset that was acquired for reading or
EOF
-
readRelease
protected abstract void readRelease(long offset) Release the offset from reading- Parameters:
offset
- the offset to release for reading
-
consumerReferenceArrayIndex
protected abstract long consumerReferenceArrayIndex(long offset) Get the position index of the consumer in the reference array- Parameters:
offset
- the current offset of the consumer returned fromreadAcquire()
- Returns:
- the consumer index
-
producerReferenceArrayIndex
protected abstract long producerReferenceArrayIndex(long offset) Get the position index of the producer in the reference array- Parameters:
offset
- the current offset of the producer returned fromwriteAcquire()
- Returns:
- the producer index
-
writeReference
Write a reference into the index of the reference array.- Parameters:
index
- the index to write toreference
- the reference to write
-
readReference
Read a reference from the index of the reference array.- Parameters:
index
- the index to read from- Returns:
- the reference that was read
-