scala.actors.scheduler

class ResizableThreadPoolScheduler

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

class ResizableThreadPoolScheduler(protected val terminate : Boolean, protected val daemon : Boolean)
extends java.lang.Thread with IScheduler with TerminationMonitor
This scheduler class uses a ThreadPoolExecutor to execute Actors. The scheduler attempts to shut down itself and the underlying ThreadPoolExecutor only if terminate is set to true. Otherwise, the scheduler must be shut down explicitly.
Author
Philipp Haller
Additional Constructor Summary
def this : ResizableThreadPoolScheduler
def this (d : Boolean) : ResizableThreadPoolScheduler
Value Summary
protected val CHECK_FREQ : Int
Values and Variables inherited from TerminationMonitor
activeActors, terminationHandlers
Method Summary
def execute (fun : => Unit) : Unit
Submits a closure for execution.
def execute (task : java.lang.Runnable) : Unit
Submits a Runnable for execution.
def isActive : Boolean
When the scheduler is active, it can execute tasks.
def managedBlock (blocker : ManagedBlocker) : Unit
def restart : Unit
Resumes the execution of the scheduler if it was previously suspended using snapshot.
override def run : Unit
def shutdown : Unit
Shuts down the scheduler.
def snapshot : Unit
Suspends the scheduler. All threads that were in use by the scheduler and its internal thread pool are terminated.
Methods inherited from TerminationMonitor
newActor, onTerminate, terminated, allTerminated, gc
Methods inherited from IScheduler
executeFromActor, tick, onLockup, onLockup, printActorDump
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(d : Boolean) : ResizableThreadPoolScheduler

def this : ResizableThreadPoolScheduler

Value Details
protected val CHECK_FREQ : Int

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

def execute(task : java.lang.Runnable) : Unit
Submits a Runnable for execution.
Parameters
task - the task to be executed
Overrides
IScheduler.execute

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

def shutdown : Unit
Shuts down the scheduler.
Overrides
IScheduler.shutdown

def isActive : Boolean
When the scheduler is active, it can execute tasks.
Overrides
IScheduler.isActive

def managedBlock(blocker : ManagedBlocker) : Unit
Overrides
IScheduler.managedBlock

def snapshot : Unit
Suspends the scheduler. All threads that were in use by the scheduler and its internal thread pool are terminated.

def restart : Unit
Resumes the execution of the scheduler if it was previously suspended using snapshot.