Package com.illumon.util.net
Class ConnectionScheduler
java.lang.Object
com.fishlib.io.sched.JobScheduler
com.illumon.util.net.ConnectionScheduler
- All Implemented Interfaces:
com.fishlib.io.sched.Scheduler
public class ConnectionScheduler extends JobScheduler
Create a private scheduler to handle jobs for a single connection.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fishlib.io.sched.JobScheduler
JobScheduler.Statistics
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ConnectionScheduler(String name, com.fishlib.io.logger.Logger log, JobScheduler.Statistics statistics, int numThreads)
Construct a new scheduler designed for use by a single connection, with the supplied name, log, and number of driver threads. -
Method Summary
Modifier and Type Method Description protected void
delegatedClose()
Allow derived implementations to do additional closing work.com.fishlib.io.logger.Logger
getLog()
Get this scheduler's logvoid
start()
Start this scheduler.void
updateDriverThreadNames(String namePrefix)
Update the names of the driver threads with a new name prefix, replacing the scheduler's name as a component of the driver thread names.Methods inherited from class com.fishlib.io.sched.JobScheduler
cancelJob, close, currentTimeMillis, installJob, installJob, isClosed, junitGetAllJobs, junitGetAllKeys, junitGetChannelsAndJobs, junitGetReadyKeys, junitGetSelector, junitGetTimeoutQueue, junitTestTimeoutQueueInvariant, work
-
Constructor Details
-
ConnectionScheduler
public ConnectionScheduler(@NotNull String name, @NotNull com.fishlib.io.logger.Logger log, @NotNull JobScheduler.Statistics statistics, int numThreads) throws IOExceptionConstruct a new scheduler designed for use by a single connection, with the supplied name, log, and number of driver threads.- Parameters:
name
- The name of the schedulerlog
- The log to be used by the schedulerstatistics
- Statistics to be reported by the super classnumThreads
- The number of driver threads to create- Throws:
IOException
-
-
Method Details
-
updateDriverThreadNames
Update the names of the driver threads with a new name prefix, replacing the scheduler's name as a component of the driver thread names. Does not change the name of the scheduler, which becomes fixed at construction time.- Parameters:
namePrefix
- The new name prefix
-
delegatedClose
protected void delegatedClose()Description copied from class:JobScheduler
Allow derived implementations to do additional closing work. Will be called fromJobScheduler.close()
only if closing work is done in this implementation.- Overrides:
delegatedClose
in classJobScheduler
-
getLog
public com.fishlib.io.logger.Logger getLog()Get this scheduler's log- Returns:
- The log
-
start
public void start()Start this scheduler.
-