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
Built in Transfer
DeliveryTag
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 type Long
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
Modifier and TypeFieldDescriptionstatic final int
The default number of pooled transfer tags for this generator.Fields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonSequentialTagGenerator
nextTagId
-
Constructor Summary
ConstructorDescriptionCreates a newProtonPooledTagGenerator
instance with the default pool size.ProtonPooledTagGenerator
(int poolSize) Creates a newProtonPooledTagGenerator
instance with the given pool size. -
Method Summary
Modifier and TypeMethodDescriptionnextTag()
Creates and returns the nextDeliveryTag
tag that should be used when populating anOutgoingDelivery
.
-
Field Details
-
DEFAULT_MAX_NUM_POOLED_TAGS
public static final int DEFAULT_MAX_NUM_POOLED_TAGSThe default number of pooled transfer tags for this generator.- See Also:
-
-
Constructor Details
-
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 Details
-
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
.
-