java.lang.Object
net.i2p.router.tunnel.pool.TestJob.RoundToken
Enclosing class:
TestJob

static final class TestJob.RoundTokenextends Object
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

    Fields
    Modifier and Type
    Field
    Description
    (package private) final AtomicBoolean
    True once one path has claimed this round; later claims are no-ops.
    (package private) final long
    When the round stops being eligible for a reply.
    (package private) final long
    Monotonic generation, for logs and token identity.
    (package private) final AtomicBoolean
    True while this round holds the global and per-pool in-flight permits.
    (package private) final String
    Pool the in-flight permits were taken from; null when the job has no pool.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • generation

      final long generation
      Monotonic generation, for logs and token identity.
    • poolId

      final String poolId
      Pool the in-flight permits were taken from; null when the job has no pool.
    • expiration

      final long expiration
      When the round stops being eligible for a reply.
    • completed

      final AtomicBoolean completed
      True once one path has claimed this round; later claims are no-ops.
    • permitsHeld

      final AtomicBoolean 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 generation
      poolId - pool identity captured at creation, or null
      expiration - reply deadline in ms