public interface ActorManager
| 限定符和类型 | 方法和说明 |
|---|---|
int |
broadcast(Message message,
Actor from)
Send a message to all actors.
|
Actor |
createActor(Class<? extends Actor> clazz,
String name)
Create an actor.
|
Actor |
createActor(Class<? extends Actor> clazz,
String name,
Map<String,Object> options)
Create an actor.
|
Actor |
createAndStartActor(Class<? extends Actor> clazz,
String name)
Create an actor then start it.
|
Actor |
createAndStartActor(Class<? extends Actor> clazz,
String name,
Map<String,Object> options)
Create an actor then start it.
|
void |
detachActor(Actor actor)
Detach an actor.
|
int |
getActorCount(Class type)
Get the count of actors.
|
Set<String> |
getCategories()
Get the categories that currently have actors.
|
void |
initialize()
Initialize this manager.
|
void |
initialize(Map<String,Object> options)
Initialize this manager.
|
int |
send(Message message,
Actor from,
Actor to)
Send a message to an actor.
|
int |
send(Message message,
Actor from,
Actor[] to)
Send a message to a set of actors.
|
int |
send(Message message,
Actor from,
Collection<Actor> to)
Send a message to a set of actors.
|
int |
send(Message message,
Actor from,
String category)
Send a message to an actor in the category.
|
void |
startActor(Actor a)
Start an actor.
|
void |
terminate()
Terminate this manager.
|
void |
terminateAndWait()
Terminate this manager.
|
Actor createActor(Class<? extends Actor> clazz, String name)
clazz - class of the actor. must have no argument constructorname - name to assign to the actor; must be unique for this managerActor createAndStartActor(Class<? extends Actor> clazz, String name)
clazz - class of the actor. must have no argument constructorname - name to assign to the actor; must be unique for this managerActor createActor(Class<? extends Actor> clazz, String name, Map<String,Object> options)
clazz - class of the actor. must have no argument constructorname - name to assign to the actor; must be unique for this managermanager - dependent parametersActor createAndStartActor(Class<? extends Actor> clazz, String name, Map<String,Object> options)
clazz - class of the actor. must have no argument constructorname - name to assign to the actor; must be unique for this managermanager - dependent parametersvoid startActor(Actor a)
a - the actorvoid detachActor(Actor actor)
a - the actorint send(Message message, Actor from, Actor to)
message - the messagefrom - the source actor; may be nullto - the target actorint send(Message message, Actor from, Actor[] to)
message - the messagefrom - the source actor; may be nullto - the target actorsint send(Message message, Actor from, Collection<Actor> to)
message - the messagefrom - the source actor; may be nullto - the target actorsint send(Message message, Actor from, String category)
message - the messagefrom - the source actor; may be nullcategory - category of the target actorint broadcast(Message message, Actor from)
message - the messagefrom - the source actor; may be nullSet<String> getCategories()
void initialize()
void initialize(Map<String,Object> options)
options - manger dependent parametersvoid terminateAndWait()
void terminate()
int getActorCount(Class type)
type - actor type; all if nullCopyright © 2021. All rights reserved.