Package io.kroxylicious.proxy.internal
Class CorrelationIdAllocator
java.lang.Object
io.kroxylicious.proxy.internal.CorrelationIdAllocator
Allocates integer correlation IDs from a bounded circular range
[minInc, maxExc).
Each call to allocateId() returns the next available ID. When the allocated
value reaches maxExc - 1, subsequent allocations wrap back to minInc.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the next correlation ID in the range, wrapping tominIncaftermaxExc - 1.booleaninRange(int id)
-
Method Details
-
allocateId
public int allocateId()Returns the next correlation ID in the range, wrapping tominIncaftermaxExc - 1.- Returns:
- the allocated correlation ID
-
inRange
public boolean inRange(int id) - Parameters:
id- id- Returns:
- true if this id is part of the range this allocator will allocate from
-