java.lang.Object
net.i2p.client.streaming.impl.SchedulerChooser
Examine a connection's state and pick the right scheduler for it.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classA scheduler that drops every task.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final I2PAppContextThe context the schedulers run in.private final LogLogger for this class.private final TaskSchedulerScheduler that runs nothing, used when the session dies.private final List<TaskScheduler> List of TaskScheduler objects.Constructor Summary
ConstructorsConstructorDescriptionSchedulerChooser(I2PAppContext context) Create a new scheduler chooser with all available schedulers.Method Summary
Modifier and TypeMethodDescriptionprivate List<TaskScheduler> Builds the pool of task schedulers.getScheduler(Connection con) Return the appropriate scheduler for the given connection.
Field Details
_context
The context the schedulers run in._log
Logger for this class._nullScheduler
Scheduler that runs nothing, used when the session dies._schedulers
List of TaskScheduler objects.
Constructor Details
SchedulerChooser
Create a new scheduler chooser with all available schedulers.- Parameters:
context- the application context
Method Details
getScheduler
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
Builds the pool of task schedulers.- Returns:
- the schedulers to use