cleanup
This commit is contained in:
parent
bb8824296a
commit
4aba589eee
2 changed files with 8 additions and 4 deletions
|
|
@ -7,6 +7,7 @@ ActorRegistry: Finding Actors
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
Actors can be looked up using the 'akka.actor.Actors.registry()' object. Through this registry you can look up actors by:
|
Actors can be looked up using the 'akka.actor.Actors.registry()' object. Through this registry you can look up actors by:
|
||||||
|
|
||||||
* uuid com.eaio.uuid.UUID – this uses the ‘uuid’ field in the Actor class, returns the actor reference for the actor with specified uuid, if one exists, otherwise None
|
* uuid com.eaio.uuid.UUID – this uses the ‘uuid’ field in the Actor class, returns the actor reference for the actor with specified uuid, if one exists, otherwise None
|
||||||
* id string – this uses the ‘id’ field in the Actor class, which can be set by the user (default is the class name), returns all actor references to actors with specified id
|
* id string – this uses the ‘id’ field in the Actor class, which can be set by the user (default is the class name), returns all actor references to actors with specified id
|
||||||
* parameterized type - returns a 'ActorRef[]' with all actors that are a subtype of this specific type
|
* parameterized type - returns a 'ActorRef[]' with all actors that are a subtype of this specific type
|
||||||
|
|
@ -74,4 +75,3 @@ The above actor can be added as listener of registry events:
|
||||||
|
|
||||||
ActorRef listener = actorOf(RegistryListener.class).start();
|
ActorRef listener = actorOf(RegistryListener.class).start();
|
||||||
registry().addListener(listener);
|
registry().addListener(listener);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ ActorRegistry: Finding Actors
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
Actors can be looked up by using the **akka.actor.Actor.registry: akka.actor.ActorRegistry**. Lookups for actors through this registry can be done by:
|
Actors can be looked up by using the **akka.actor.Actor.registry: akka.actor.ActorRegistry**. Lookups for actors through this registry can be done by:
|
||||||
|
|
||||||
* uuid akka.actor.Uuid – this uses the ‘**uuid**’ field in the Actor class, returns the actor reference for the actor with specified uuid, if one exists, otherwise None
|
* uuid akka.actor.Uuid – this uses the ‘**uuid**’ field in the Actor class, returns the actor reference for the actor with specified uuid, if one exists, otherwise None
|
||||||
* id string – this uses the ‘**id**’ field in the Actor class, which can be set by the user (default is the class name), returns all actor references to actors with specified id
|
* id string – this uses the ‘**id**’ field in the Actor class, which can be set by the user (default is the class name), returns all actor references to actors with specified id
|
||||||
* specific actor class - returns an '**Array[Actor]**' with all actors of this exact class
|
* specific actor class - returns an '**Array[Actor]**' with all actors of this exact class
|
||||||
|
|
@ -78,6 +79,7 @@ The messages sent to this Actor are:
|
||||||
So your listener Actor needs to be able to handle these two messages. Example:
|
So your listener Actor needs to be able to handle these two messages. Example:
|
||||||
|
|
||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
import akka.actor.Actor
|
import akka.actor.Actor
|
||||||
import akka.actor.ActorRegistered;
|
import akka.actor.ActorRegistered;
|
||||||
import akka.actor.ActorUnregistered;
|
import akka.actor.ActorUnregistered;
|
||||||
|
|
@ -95,10 +97,12 @@ So your listener Actor needs to be able to handle these two messages. Example:
|
||||||
}
|
}
|
||||||
|
|
||||||
The above actor can be added as listener of registry events:
|
The above actor can be added as listener of registry events:
|
||||||
|
|
||||||
.. code-block:: scala
|
.. code-block:: scala
|
||||||
|
|
||||||
import akka.actor._
|
import akka.actor._
|
||||||
import akka.actor.Actor._
|
import akka.actor.Actor._
|
||||||
|
|
||||||
val listener = actorOf[RegistryListener].start
|
val listener = actorOf[RegistryListener].start
|
||||||
registry.addListener(listener)
|
registry.addListener(listener)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue