Construct a path below the application guardian to be used with ActorSystem.actorFor.
Construct a path below the application guardian to be used with ActorSystem.actorFor.
Create new actor as child of this context with the given name, which must not be null, empty or start with “$”.
Create new actor as child of this context with the given name, which must
not be null, empty or start with “$”. If the given name is already in use,
and InvalidActorNameException
is thrown.
See akka.actor.Props for details on how to obtain a Props
object.
When invoked on ActorSystem, this method sends a message to the guardian
actor and blocks waiting for a reply, see akka.actor.creation-timeout
in
the reference.conf
.
Create new actor as child of this context and give it an automatically generated name (currently similar to base64-encoded integer count, reversed and with “$” prepended, may change in the future).
Create new actor as child of this context and give it an automatically generated name (currently similar to base64-encoded integer count, reversed and with “$” prepended, may change in the future).
See akka.actor.Props for details on how to obtain a Props
object.
When invoked on ActorSystem, this method sends a message to the guardian
actor and blocks waiting for a reply, see akka.actor.creation-timeout
in
the reference.conf
.
Block current thread until the system has been shutdown.
Block current thread until the system has been shutdown. This will block until after all on termination callbacks have been run.
Block current thread until the system has been shutdown, or the specified timeout has elapsed.
Block current thread until the system has been shutdown, or the specified timeout has elapsed. This will block until after all on termination callbacks have been run.
in case of timeout
Actor reference where messages are re-routed to which were addressed to stopped or non-existing actors.
Actor reference where messages are re-routed to which were addressed to stopped or non-existing actors. Delivery to this actor is done on a best effort basis and hence not strictly guaranteed.
Default dispatcher as configured.
Default dispatcher as configured. This dispatcher is used for all actors in the actor system which do not have a different dispatcher configured explicitly. Importing this member will place the default MessageDispatcher in scope.
Helper object for looking up configured dispatchers.
Main event bus of this actor system, used for example for logging.
Returns the payload that is associated with the provided extension throws an IllegalStateException if it is not registered.
Returns the payload that is associated with the provided extension throws an IllegalStateException if it is not registered. This method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution
Father of all children created by this interface.
Father of all children created by this interface.
INTERNAL USE ONLY
Returns whether the specified extension is already registered, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution
Query the termination status: if it returns true, all callbacks have run and the ActorSystem has been fully stopped, i.
Query the termination status: if it returns true, all callbacks have run
and the ActorSystem has been fully stopped, i.e.
awaitTermination(0 seconds)
would return normally. If this method
returns false
, the status is actually unknown, since it might have
changed since you queried it.
Convenient logging adapter for logging to the ActorSystem.eventStream.
Log the configuration.
INTERNAL USE ONLY
INTERNAL USE ONLY
The name of this actor system, used to distinguish multiple ones within the same JVM & class loader.
INTERNAL USE ONLY
INTERNAL USE ONLY
Registers the provided extension and creates its payload, if this extension isn't already registered This method has putIfAbsent-semantics, this method can potentially block, waiting for the initialization of the payload, if is in the process of registration from another Thread of execution
Java API: Register a block of code (callback) to run after ActorSystem.
Java API: Register a block of code (callback) to run after ActorSystem.shutdown has been issued and all actors in this actor system have been stopped. Multiple code blocks may be registered by calling this method multiple times. The callbacks will be run sequentially in reverse order of registration, i.e. last registration is run first.
RejectedExecutionException if the System has already shut down or if shutdown has been initiated.
Register a block of code (callback) to run after ActorSystem.
Register a block of code (callback) to run after ActorSystem.shutdown has been issued and all actors in this actor system have been stopped. Multiple code blocks may be registered by calling this method multiple times. The callbacks will be run sequentially in reverse order of registration, i.e. last registration is run first.
RejectedExecutionException if the System has already shut down or if shutdown has been initiated.
Scala API
Light-weight scheduler for running asynchronous tasks after some deadline in the future.
Light-weight scheduler for running asynchronous tasks after some deadline in the future. Not terribly precise but cheap.
The core settings extracted from the supplied configuration.
Stop this actor system.
Stop this actor system. This will stop the guardian actor, which in turn will recursively stop all its child actors, then the system guardian (below which the logging actors reside) and the execute all registered termination handlers (see ActorSystem.registerOnTermination).
Stop the actor pointed to by the given akka.actor.ActorRef; this is an asynchronous operation, i.
Stop the actor pointed to by the given akka.actor.ActorRef; this is
an asynchronous operation, i.e. involves a message send.
When invoked on akka.actor.ActorSystem for a top-level actor, this
method sends a message to the guardian actor and blocks waiting for a reply,
see akka.actor.creation-timeout
in the reference.conf
.
INTERNAL USE ONLY
INTERNAL USE ONLY
Java API: Look-up an actor by applying the given path elements, starting from the
current context, where ".."
signifies the parent of an actor.
Java API: Look-up an actor by applying the given path elements, starting from the
current context, where ".."
signifies the parent of an actor.
Example:
public class MyActor extends UntypedActor { public void onReceive(Object msg) throws Exception { ... final List<String> path = new ArrayList<String>(); path.add(".."); path.add("myBrother"); path.add("myNephew"); final ActorRef target = context().actorFor(path); ... } }
For maximum performance use a collection with efficient head & tail operations.
Look-up an actor by applying the given path elements, starting from the
current context, where ".."
signifies the parent of an actor.
Look-up an actor by applying the given path elements, starting from the
current context, where ".."
signifies the parent of an actor.
Example:
class MyActor extends Actor { def receive = { case msg => ... val target = context.actorFor(Seq("..", "myBrother", "myNephew")) ... } }
For maximum performance use a collection with efficient head & tail operations.
Look-up an actor by path represented as string.
Look-up an actor by path represented as string.
Absolute URIs like akka://appname/user/actorA
are looked up as described
for look-ups by actorOf(ActorPath)
.
Relative URIs like /service/actorA/childB
are looked up relative to the
root path of the akka.actor.ActorSystem containing this factory and as
described for look-ups by actorOf(Iterable[String])
.
Relative URIs like myChild/grandChild
or ../myBrother
are looked up
relative to the current context as described for look-ups by
actorOf(Iterable[String])
Look-up an actor by path; if it does not exist, returns a reference to the dead-letter mailbox of the akka.actor.ActorSystem.
Look-up an actor by path; if it does not exist, returns a reference to
the dead-letter mailbox of the akka.actor.ActorSystem. If the path
point to an actor which is not local, no attempt is made during this
call to verify that the actor it represents does exist or is alive; use
watch(ref)
to be notified of the target’s termination, which is also
signaled if the queried path cannot be resolved.
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally).
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally). No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors.
Java API: Create a new child actor path.
Java API: Recursively create a descendant’s path by appending all child names.
Start-up time in milliseconds since the epoch.
Up-time of this actor system in seconds.
An actor system is a hierarchical group of actors which share common configuration, e.g. dispatchers, deployments, remote capabilities and addresses. It is also the entry point for creating or looking up actors.
There are several possibilities for creating actors (see akka.actor.Props for details on
props
):Where no name is given explicitly, one will be automatically generated.
Important Notice:
This class is not meant to be extended by user code. If you want to actually roll your own Akka, it will probably be better to look into extending akka.actor.ExtendedActorSystem instead, but beware that you are completely on your own in that case!