Merge branch 'master' of git@github.com:jboner/akka

Conflicts:
	akka-actor/src/main/resources/logback.xml
	akka-actor/src/main/scala/dataflow/DataFlowVariable.scala
	akka-actor/src/test/scala/dataflow/DataFlowSpec.scala
	akka-remote/src/main/scala/remote/RemoteClient.scala
	akka-remote/src/test/resources/logback-test.xml
This commit is contained in:
Jonas Bonér 2010-08-29 17:33:29 +02:00
commit 4a339f835a
15 changed files with 311 additions and 237 deletions

View file

@ -9,9 +9,8 @@ import java.util.List
import se.scalablesolutions.akka.util.{HashCode, Logging}
import se.scalablesolutions.akka.actor.{Actor, ActorRef, ActorInitializationException}
import java.util.concurrent.ConcurrentHashMap
import org.multiverse.commitbarriers.CountDownCommitBarrier
import java.util.concurrent.{ConcurrentSkipListSet}
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
@ -68,16 +67,16 @@ trait MessageQueue {
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
trait MessageDispatcher extends Logging {
protected val references = new ConcurrentHashMap[String, ActorRef]
protected val uuids = new ConcurrentSkipListSet[String]
def dispatch(invocation: MessageInvocation)
def start
def shutdown
def register(actorRef: ActorRef) = references.put(actorRef.uuid, actorRef)
def register(actorRef: ActorRef) = uuids add actorRef.uuid
def unregister(actorRef: ActorRef) = {
references.remove(actorRef.uuid)
uuids remove actorRef.uuid
if (canBeShutDown) shutdown // shut down in the dispatcher's references is zero
}
def canBeShutDown: Boolean = references.isEmpty
def canBeShutDown: Boolean = uuids.isEmpty
def isShutdown: Boolean
def mailboxSize(actorRef: ActorRef):Int = 0
}