java.lang.Object
net.i2p.router.tunnel.pool.TestJob.RoundToken
- Enclosing class:
TestJob
Identity of one dispatched test round: the generation it belongs to, the pool it counts against, the deadline it expires at, and the release switches for the permits it reserved. Reply, timeout, and dispatch failure all hold the token they were built for, so a delayed callback from an earlier round can never complete, release, or clear state that now belongs to a later one. The old flags on the instance had no way to tell which round they referred to.
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicBooleanTrue once one path has claimed this round; later claims are no-ops.(package private) final longWhen the round stops being eligible for a reply.(package private) final longMonotonic generation, for logs and token identity.(package private) final AtomicBooleanTrue while this round holds the global and per-pool in-flight permits.(package private) final StringPool the in-flight permits were taken from; null when the job has no pool.Constructor Summary
ConstructorsConstructorDescriptionRoundToken(long generation, String poolId, long expiration) Name this round, so a callback can be matched against the round it was built for rather than against whatever the instance considers live.Method Summary
Field Details
generation
final long generationMonotonic generation, for logs and token identity.poolId
Pool the in-flight permits were taken from; null when the job has no pool.expiration
final long expirationWhen the round stops being eligible for a reply.completed
True once one path has claimed this round; later claims are no-ops.permitsHeld
True while this round holds the global and per-pool in-flight permits.
Constructor Details
RoundToken
RoundToken(long generation, String poolId, long expiration) Name this round, so a callback can be matched against the round it was built for rather than against whatever the instance considers live.- Parameters:
generation- monotonic round generationpoolId- pool identity captured at creation, or nullexpiration- reply deadline in ms