Added some more localActorOf methods and use them internally in cluster
This commit is contained in:
parent
1997d971a0
commit
241831c5ee
2 changed files with 14 additions and 2 deletions
|
|
@ -317,14 +317,26 @@ object Actor extends ListenerManagement {
|
||||||
newLocalActorRef(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]], new UUID().toString)
|
newLocalActorRef(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]], new UUID().toString)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def localActorOf[T <: Actor: Manifest](address: String): ActorRef = {
|
||||||
|
newLocalActorRef(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]], address)
|
||||||
|
}
|
||||||
|
|
||||||
def localActorOf[T <: Actor](clazz: Class[T]): ActorRef = {
|
def localActorOf[T <: Actor](clazz: Class[T]): ActorRef = {
|
||||||
newLocalActorRef(clazz, new UUID().toString)
|
newLocalActorRef(clazz, new UUID().toString)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def localActorOf[T <: Actor](clazz: Class[T], address: String): ActorRef = {
|
||||||
|
newLocalActorRef(clazz, address)
|
||||||
|
}
|
||||||
|
|
||||||
def localActorOf[T <: Actor](factory: ⇒ T): ActorRef = {
|
def localActorOf[T <: Actor](factory: ⇒ T): ActorRef = {
|
||||||
new LocalActorRef(() ⇒ factory, new UUID().toString, Transient)
|
new LocalActorRef(() ⇒ factory, new UUID().toString, Transient)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def localActorOf[T <: Actor](factory: ⇒ T, address: String): ActorRef = {
|
||||||
|
new LocalActorRef(() ⇒ factory, address, Transient)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use to spawn out a block of code in an event-driven actor. Will shut actor down when
|
* Use to spawn out a block of code in an event-driven actor. Will shut actor down when
|
||||||
* the block has been executed.
|
* the block has been executed.
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ class DefaultClusterNode private[akka] (
|
||||||
|
|
||||||
import Cluster._
|
import Cluster._
|
||||||
|
|
||||||
lazy val remoteClientLifeCycleListener = actorOf(new Actor {
|
lazy val remoteClientLifeCycleListener = localActorOf(new Actor {
|
||||||
def receive = {
|
def receive = {
|
||||||
case RemoteClientError(cause, client, address) ⇒ client.shutdownClientModule()
|
case RemoteClientError(cause, client, address) ⇒ client.shutdownClientModule()
|
||||||
case RemoteClientDisconnected(client, address) ⇒ client.shutdownClientModule()
|
case RemoteClientDisconnected(client, address) ⇒ client.shutdownClientModule()
|
||||||
|
|
@ -291,7 +291,7 @@ class DefaultClusterNode private[akka] (
|
||||||
}
|
}
|
||||||
}, "akka.cluster.RemoteClientLifeCycleListener").start()
|
}, "akka.cluster.RemoteClientLifeCycleListener").start()
|
||||||
|
|
||||||
lazy val remoteDaemon = actorOf(new RemoteClusterDaemon(this), RemoteClusterDaemon.ADDRESS).start()
|
lazy val remoteDaemon = localActorOf(new RemoteClusterDaemon(this), RemoteClusterDaemon.ADDRESS).start()
|
||||||
|
|
||||||
lazy val remoteDaemonSupervisor = Supervisor(
|
lazy val remoteDaemonSupervisor = Supervisor(
|
||||||
SupervisorConfig(
|
SupervisorConfig(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue