Added method to ClusterNode to check if an actor is checked out on a specific (other) node, also added 'start' and 'boot' methods.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
aeb8178007
commit
f9e82eaee5
2 changed files with 18 additions and 4 deletions
|
|
@ -378,13 +378,13 @@ class DefaultClusterNode private[akka] (
|
|||
|
||||
if (enableJMX) createMBean
|
||||
|
||||
initializeNode()
|
||||
boot()
|
||||
|
||||
// =======================================
|
||||
// Node
|
||||
// =======================================
|
||||
|
||||
private[cluster] def initializeNode() {
|
||||
private[cluster] def boot() {
|
||||
EventHandler.info(this,
|
||||
("\nCreating cluster node with" +
|
||||
"\n\tcluster name = [%s]" +
|
||||
|
|
@ -404,6 +404,8 @@ class DefaultClusterNode private[akka] (
|
|||
|
||||
def isShutdown = isShutdownFlag.get
|
||||
|
||||
def start() {}
|
||||
|
||||
def shutdown() {
|
||||
isShutdownFlag.set(true)
|
||||
|
||||
|
|
@ -715,6 +717,11 @@ class DefaultClusterNode private[akka] (
|
|||
*/
|
||||
def isInUseOnNode(actorAddress: String, node: NodeAddress): Boolean = zkClient.exists(actorAddressToNodesPathFor(actorAddress, node.nodeName))
|
||||
|
||||
/**
|
||||
* Is the actor with uuid in use or not?
|
||||
*/
|
||||
def isInUseOnNode(actorAddress: String, nodeName: String): Boolean = zkClient.exists(actorAddressToNodesPathFor(actorAddress, nodeName))
|
||||
|
||||
/**
|
||||
* Checks out an actor for use on this node, e.g. checked out as a 'LocalActorRef' but it makes it available
|
||||
* for remote access through lookup by its UUID.
|
||||
|
|
@ -1665,7 +1672,7 @@ class StateListener(self: ClusterNode) extends IZkStateListener {
|
|||
*/
|
||||
def handleNewSession() {
|
||||
EventHandler.debug(this, "Session expired re-initializing node [%s]".format(self.nodeAddress))
|
||||
self.initializeNode()
|
||||
self.boot()
|
||||
self.publish(NewSession)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue