scala.actors.scheduler

class ThreadPoolScheduler

[source: scala/actors/scheduler/ThreadPoolScheduler.scala]

class ThreadPoolScheduler(protected val executor : java.util.concurrent.ThreadPoolExecutor, protected val terminate : Boolean)
extends java.lang.Thread with TerminationMonitor with ExecutorScheduler
The ThreadPoolScheduler class uses an ThreadPoolExecutor to execute Actors. A ThreadPoolScheduler attempts to shut down the underlying ExecutorService only if terminate is set to true. Otherwise, the ExecutorService must be shut down either directly or by shutting down the ThreadPoolScheduler instance.
Author
Philipp Haller
Additional Constructor Summary
def this : ThreadPoolScheduler
Value Summary
protected val CHECK_FREQ : Int
Method Summary
def execute (fun : => Unit) : Unit
Submits a closure for execution.
override def managedBlock (blocker : ManagedBlocker) : Unit
override def run : Unit
def shutdown : Unit
Shuts down the scheduler.
Methods inherited from ExecutorScheduler
onShutdown, isActive
Methods inherited from ThreadPoolRunner
submit, execute
Methods inherited from TaskRunner
!!, tryCatch
Methods inherited from IScheduler
executeFromActor
Methods inherited from TerminationMonitor
newActor, onTerminate, terminated, allTerminated
Methods inherited from java.lang.Thread
java.lang.Thread.start, java.lang.Thread.stop, java.lang.Thread.stop, java.lang.Thread.interrupt, java.lang.Thread.isInterrupted, java.lang.Thread.destroy, java.lang.Thread.isAlive, java.lang.Thread.suspend, java.lang.Thread.resume, java.lang.Thread.setPriority, java.lang.Thread.getPriority, java.lang.Thread.setName, java.lang.Thread.getName, java.lang.Thread.getThreadGroup, java.lang.Thread.countStackFrames, java.lang.Thread.join, java.lang.Thread.join, java.lang.Thread.join, java.lang.Thread.setDaemon, java.lang.Thread.isDaemon, java.lang.Thread.checkAccess, java.lang.Thread.toString, java.lang.Thread.getContextClassLoader, java.lang.Thread.setContextClassLoader, java.lang.Thread.getStackTrace, java.lang.Thread.getId, java.lang.Thread.getState, java.lang.Thread.getUncaughtExceptionHandler, java.lang.Thread.setUncaughtExceptionHandler
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Additional Constructor Details
def this : ThreadPoolScheduler

Value Details
protected val CHECK_FREQ : Int

Method Details
override def managedBlock(blocker : ManagedBlocker) : Unit

override def run : Unit
Overrides
java.lang.Thread.java.lang.Thread.run

def execute(fun : => Unit) : Unit
Submits a closure for execution.
Parameters
fun - the closure to be executed

def shutdown : Unit
Shuts down the scheduler.