public abstract class WorkerPool
extends akka.actor.UntypedActor
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULTWORKERS
Default number of workers in a pool
|
protected akka.actor.ActorRef |
router
Manages the workers
|
Constructor and Description |
---|
WorkerPool() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
genMessage(java.lang.String orig)
Prepends this instance's ID to a String.
|
akka.actor.ActorRef |
getRouter()
Retrieves the worker manager Actor
|
void |
setRouter(akka.actor.ActorRef router)
Sets the worker manager
|
void |
shutdown()
Initiates shutdown
|
void |
start(java.lang.Class<? extends akka.actor.UntypedActor> workerClass,
java.lang.Object... args)
Creates a new worker pool that tries to send to the non-suspended routee with fewest messages in mailbox.
|
void |
start(int numWorkers,
java.lang.Class<? extends akka.actor.UntypedActor> workerClass,
java.lang.Object... args)
Creates a new worker pool that tries to send to the non-suspended routee with fewest messages in mailbox.
|
void |
start(akka.routing.Pool pool,
java.lang.Class<? extends akka.actor.UntypedActor> workerClass,
java.lang.Object... args)
Creates a new pool of workers
|
void |
tellRouter(java.lang.Object message)
Sends an Akka message to the worker pool from this instance
|
void |
tellRouter(java.lang.Object message,
akka.actor.ActorRef sender)
Sends an Akka message to the worker pool
|
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, getContext, getSelf, getSender, onReceive, postRestart, postStop, preRestart, preStart, receive, self, sender, supervisorStrategy, unhandled
protected akka.actor.ActorRef router
protected static final int DEFAULTWORKERS
public void start(akka.routing.Pool pool, java.lang.Class<? extends akka.actor.UntypedActor> workerClass, java.lang.Object... args)
pool
- Router actor that creates workersworkerClass
- the type of worker in the poolargs
- constructor arguments for the worker classpublic void start(int numWorkers, java.lang.Class<? extends akka.actor.UntypedActor> workerClass, java.lang.Object... args)
numWorkers
- number of workers in the poolworkerClass
- class of workerargs
- optional constructor arguments for the workerpublic void start(java.lang.Class<? extends akka.actor.UntypedActor> workerClass, java.lang.Object... args)
workerClass
- class of workerargs
- optional constructor arguments for the workerpublic java.lang.String genMessage(java.lang.String orig)
orig
- original messagepublic akka.actor.ActorRef getRouter()
public void setRouter(akka.actor.ActorRef router)
router
- new routerpublic void tellRouter(java.lang.Object message, akka.actor.ActorRef sender)
message
- message to sendsender
- message's senderpublic void tellRouter(java.lang.Object message)
message
- message to sendpublic void shutdown()