scala.actors

trait ActorGC

[source: scala/actors/ActorGC.scala]

trait ActorGC
extends TerminationMonitor
ActorGC keeps track of the number of live actors being managed by a a scheduler so that it can shutdown when all of the actors it manages have either been explicitly terminated or garbage collected. When an actor is started, it is registered with the ActorGC via the newActor method, and when an actor is knowingly terminated (e.g. act method finishes, exit explicitly called, an exception is thrown), the ActorGC is informed via the terminated method.
Direct Known Subclasses:
SchedulerService

Values and Variables inherited from TerminationMonitor
activeActors, terminationHandlers
Method Summary
override def allTerminated : Boolean
Checks whether all actors have terminated.
protected override def gc : Unit
Checks for actors that have become garbage.
override def newActor (a : Reactor) : Unit
newActor is invoked whenever a new actor is started.
override def onTerminate (a : Reactor)(f : => Unit) : Unit
Registers a closure to be executed when the specified actor terminates.
protected def status : Unit
Prints some status information on currently managed actors.
override def terminated (a : Reactor) : Unit
Registers that the specified actor has terminated.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
override def newActor(a : Reactor) : Unit
newActor is invoked whenever a new actor is started.
Overrides
TerminationMonitor.newActor

protected override def gc : Unit
Checks for actors that have become garbage.
Overrides
TerminationMonitor.gc

protected def status : Unit
Prints some status information on currently managed actors.

override def allTerminated : Boolean
Checks whether all actors have terminated.
Overrides
TerminationMonitor.allTerminated

override def onTerminate(a : Reactor)(f : => Unit) : Unit
Registers a closure to be executed when the specified actor terminates.
Parameters
a - the actor
f - the closure to be registered
Overrides
TerminationMonitor.onTerminate

override def terminated(a : Reactor) : Unit
Registers that the specified actor has terminated.
Parameters
a - the actor that has terminated
Overrides
TerminationMonitor.terminated