java.lang.Object
net.i2p.client.streaming.impl.SchedulerChooser

class SchedulerChooserextends Object
Examine a connection's state and pick the right scheduler for it.
  • Field Details

    • _context

      private final I2PAppContext _context
      The context the schedulers run in.
    • _log

      private final Log _log
      Logger for this class.
    • _nullScheduler

      private final TaskScheduler _nullScheduler
      Scheduler that runs nothing, used when the session dies.
    • _schedulers

      private final List<TaskScheduler> _schedulers
      List of TaskScheduler objects.
  • Constructor Details

    • SchedulerChooser

      public SchedulerChooser(I2PAppContext context)
      Create a new scheduler chooser with all available schedulers.
      Parameters:
      context - the application context
  • Method Details

    • getScheduler

      public TaskScheduler getScheduler(Connection con)
      Return the appropriate scheduler for the given connection.
      Parameters:
      con - the connection to schedule
      Returns:
      the scheduler that accepts this connection, or the null scheduler
    • createSchedulers

      private List<TaskScheduler> createSchedulers()
      Builds the pool of task schedulers.
      Returns:
      the schedulers to use