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:
commit
4a339f835a
15 changed files with 311 additions and 237 deletions
|
|
@ -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ér</a>
|
||||
|
|
@ -68,16 +67,16 @@ trait MessageQueue {
|
|||
* @author <a href="http://jonasboner.com">Jonas Boné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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue