From dbb58b11702cee27b5ea70c5d1dd71986f34c79d Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Thu, 28 May 2009 20:42:07 +0000 Subject: Re-enabled SchedulerAdapter. --- src/actors/scala/actors/SchedulerAdapter.scala | 31 +++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/actors/scala/actors/SchedulerAdapter.scala b/src/actors/scala/actors/SchedulerAdapter.scala index c56f3b0f9c..f47f0cbd0f 100644 --- a/src/actors/scala/actors/SchedulerAdapter.scala +++ b/src/actors/scala/actors/SchedulerAdapter.scala @@ -6,6 +6,8 @@ ** |/ ** \* */ +// $Id$ + package scala.actors /** The SchedulerAdapter trait is used to adapt @@ -15,7 +17,6 @@ package scala.actors * execute(f: => Unit) method is sufficient to * obtain a concrete class that extends IScheduler. * - * @version 0.9.18 * @author Philipp Haller */ trait SchedulerAdapter extends IScheduler { @@ -32,4 +33,32 @@ trait SchedulerAdapter extends IScheduler { def shutdown(): Unit = Scheduler.shutdown() + /** When the scheduler is active, it can execute tasks. + */ + def isActive: Boolean = + Scheduler.isActive + + /** Registers a newly created actor with this scheduler. + * + * @param a the actor to be registered + */ + def newActor(a: OutputChannelActor) = + Scheduler.newActor(a) + + /** Unregisters an actor from this scheduler, because it + * has terminated. + * + * @param a the actor to be unregistered + */ + def terminated(a: OutputChannelActor) = + Scheduler.terminated(a) + + /** Registers a closure to be executed when the specified + * actor terminates. + * + * @param a the actor + * @param f the closure to be registered + */ + def onTerminate(a: OutputChannelActor)(f: => Unit) = + Scheduler.onTerminate(a)(f) } -- cgit v1.2.3