Package org.jctools.channels.proxy
Class ProxyChannelRingBuffer
- java.lang.Object
-
- org.jctools.channels.proxy.ProxyChannelRingBuffer
-
- Direct Known Subclasses:
OffHeapFixedMessageSizeRingBuffer
public abstract class ProxyChannelRingBuffer extends java.lang.ObjectThis is the definition of the API required for the byte code generated by theProxyChannelFactory
-
-
Field Summary
Fields Modifier and Type Field Description static longEOF
-
Constructor Summary
Constructors Constructor Description ProxyChannelRingBuffer()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description protected abstract longconsumerReferenceArrayIndex(long offset)Get the position index of the consumer in the reference arrayprotected abstract longproducerReferenceArrayIndex(long offset)Get the position index of the producer in the reference arrayprotected abstract longreadAcquire()Acquire an offset to read fromprotected abstract java.lang.ObjectreadReference(long index)Read a reference from the index of the reference array.protected abstract voidreadRelease(long offset)Release the offset from readingprotected abstract longwriteAcquire()Acquire an offset to write to.protected abstract voidwriteReference(long index, java.lang.Object reference)Write a reference into the index of the reference array.protected abstract voidwriteRelease(long offset, int callTypeId)Ordered store of the callTypeId for the message at offset
-
-
-
Field Detail
-
EOF
public static final long EOF
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
protected abstract void writeReference(long index, java.lang.Object reference)Write a reference into the index of the reference array.- Parameters:
index- the index to write toreference- the reference to write
-
readReference
protected abstract java.lang.Object readReference(long index)
Read a reference from the index of the reference array.- Parameters:
index- the index to read from- Returns:
- the reference that was read
-
-