Class ProtonPooledTagGenerator
- java.lang.Object
-
- org.apache.qpid.protonj2.engine.impl.ProtonDeliveryTagGenerator
-
- org.apache.qpid.protonj2.engine.impl.ProtonSequentialTagGenerator
-
- org.apache.qpid.protonj2.engine.impl.ProtonPooledTagGenerator
-
- All Implemented Interfaces:
DeliveryTagGenerator
public class ProtonPooledTagGenerator extends ProtonSequentialTagGenerator
Built in TransferDeliveryTag
generator that uses a fixed size tag pool to reduce GC overhead by reusing tags that have been released from settled messages. When not using cached tags the generator creates new tags using a running tag counter of typeLong
that assumes that when it wraps the user has already release all tags within the lower range of the tag counter.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.qpid.protonj2.engine.impl.ProtonSequentialTagGenerator
ProtonSequentialTagGenerator.ProtonNumericDeliveryTag
-
Nested classes/interfaces inherited from class org.apache.qpid.protonj2.engine.impl.ProtonDeliveryTagGenerator
ProtonDeliveryTagGenerator.BUILTIN
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_NUM_POOLED_TAGS
The default number of pooled transfer tags for this generator.-
Fields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonSequentialTagGenerator
nextTagId
-
-
Constructor Summary
Constructors Constructor Description ProtonPooledTagGenerator()
Creates a newProtonPooledTagGenerator
instance with the default pool size.ProtonPooledTagGenerator(int poolSize)
Creates a newProtonPooledTagGenerator
instance with the given pool size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeliveryTag
nextTag()
Creates and returns the nextDeliveryTag
tag that should be used when populating anOutgoingDelivery
.
-
-
-
Field Detail
-
DEFAULT_MAX_NUM_POOLED_TAGS
public static final int DEFAULT_MAX_NUM_POOLED_TAGS
The default number of pooled transfer tags for this generator.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProtonPooledTagGenerator
public ProtonPooledTagGenerator()
Creates a newProtonPooledTagGenerator
instance with the default pool size.
-
ProtonPooledTagGenerator
public ProtonPooledTagGenerator(int poolSize)
Creates a newProtonPooledTagGenerator
instance with the given pool size.- Parameters:
poolSize
- The size of the transfer tag pool that should be allocated for this generator.
-
-
Method Detail
-
nextTag
public DeliveryTag nextTag()
Description copied from interface:DeliveryTagGenerator
Creates and returns the nextDeliveryTag
tag that should be used when populating anOutgoingDelivery
.- Specified by:
nextTag
in interfaceDeliveryTagGenerator
- Overrides:
nextTag
in classProtonSequentialTagGenerator
- Returns:
- the next
DeliveryTag
to use for anOutgoingDelivery
.
-
-