java.lang.Object
net.i2p.client.streaming.impl.SchedulerImpl
- All Implemented Interfaces:
TaskScheduler
- Direct Known Subclasses:
SchedulerClosed, SchedulerClosing, SchedulerConnectedBulk, SchedulerConnecting, SchedulerDead, SchedulerHardDisconnected, SchedulerPreconnect, SchedulerReceived
Base class for connection state schedulers. Provides common utilities for rescheduling events and logging.
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final I2PAppContextApplication context the scheduled connections live in.protected final LogLogger scoped to this scheduler class.Constructor Summary
ConstructorsConstructorDescriptionCreate a new scheduler with the given context.Method Summary
Public MethodsModifier and TypeMethodDescriptionprotected voidreschedule(long msToWait, Connection con) Schedule a connection event to occur after the specified delay.toString()Name of the scheduler class.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface TaskScheduler
accept, eventOccurredModifier and TypeMethodDescriptionbooleanaccept(Connection con) Determine whether this scheduler is fit to operate against the given connection.voideventOccurred(Connection con) An event has occurred (timeout, message sent, or message received), so schedule what to do next based on our current state.
Field Details
_context
Application context the scheduled connections live in._log
Logger scoped to this scheduler class.
Constructor Details
SchedulerImpl
Create a new scheduler with the given context.- Parameters:
ctx- the application context
Method Details
reschedule
Schedule a connection event to occur after the specified delay.- Parameters:
msToWait- the delay in millisecondscon- the connection to reschedule
toString