public class ActorSystemImpl extends ExtendedActorSystem
| Modifier and Type | Class and Description |
|---|---|
class |
ActorSystemImpl.TerminationCallbacks |
ActorSystem.Settings| Constructor and Description |
|---|
ActorSystemImpl(java.lang.String name,
com.typesafe.config.Config applicationConfig,
java.lang.ClassLoader classLoader,
scala.Option<scala.concurrent.ExecutionContext> defaultExecutionContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
This kind of shutdown attempts to bring the system down and release its
resources more forcefully than plain shutdown.
|
boolean |
aborting() |
ActorRef |
actorOf(Props props)
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).
|
ActorRef |
actorOf(Props props,
java.lang.String name)
Create new actor as child of this context with the given name, which must
not be null, empty or start with “$”.
|
void |
awaitTermination()
Block current thread until the system has been shutdown.
|
void |
awaitTermination(scala.concurrent.duration.Duration timeout)
Block current thread until the system has been shutdown, or the specified
timeout has elapsed.
|
protected DynamicAccess |
createDynamicAccess()
This is an extension point: by overriding this method, subclasses can
control all reflection activities of an actor system.
|
protected Scheduler |
createScheduler()
Create the scheduler service.
|
ActorRef |
deadLetters()
Actor reference where messages are re-routed to which were addressed to
stopped or non-existing actors.
|
scala.concurrent.ExecutionContextExecutor |
dispatcher()
Default dispatcher as configured.
|
akka.dispatch.Dispatchers |
dispatchers()
Helper object for looking up configured dispatchers.
|
DynamicAccess |
dynamicAccess()
ClassLoader wrapper which is used for reflective accesses internally.
|
akka.event.EventStream |
eventStream()
Main event bus of this actor system, used for example for logging.
|
<T extends Extension> |
extension(ExtensionId<T> ext)
Returns the payload that is associated with the provided extension
throws an IllegalStateException if it is not registered.
|
LocalActorRef |
guardian()
The top-level supervisor of all actors created using system.actorOf(...).
|
boolean |
hasExtension(ExtensionId<? extends Extension> ext)
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
|
scala.concurrent.ExecutionContext |
internalCallingThreadExecutionContext() |
boolean |
isTerminated()
Query the termination status: if it returns true, all callbacks have run
and the ActorSystem has been fully stopped, i.e.
|
akka.event.LoggingAdapter |
log()
Convenient logging adapter for logging to the
ActorSystem.eventStream. |
void |
logConfiguration()
Log the configuration.
|
InternalActorRef |
lookupRoot()
INTERNAL API
|
akka.dispatch.Mailboxes |
mailboxes()
Helper object for looking up configured mailbox types.
|
java.lang.String |
name()
The name of this actor system, used to distinguish multiple ones within
the same JVM & class loader.
|
java.lang.String |
printTree()
For debugging: traverse actor hierarchy and make string representation.
|
ActorRefProvider |
provider()
The ActorRefProvider is the only entity which creates all actor references within this actor system.
|
<T extends Extension> |
registerExtension(ExtensionId<T> ext)
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
|
<T> void |
registerOnTermination(scala.Function0<T> code)
Register a block of code (callback) to run after ActorSystem.shutdown has been issued and
all actors in this actor system have been stopped.
|
void |
registerOnTermination(java.lang.Runnable code)
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.
|
Scheduler |
scheduler()
Light-weight scheduler for running asynchronous tasks after some deadline
in the future.
|
ActorSystem.Settings |
settings()
The core settings extracted from the supplied configuration.
|
void |
shutdown()
Stop this actor system.
|
ActorSystemImpl |
start() |
void |
stop(ActorRef actor)
Stop the actor pointed to by the given
ActorRef; this is
an asynchronous operation, i.e. |
protected void |
stopScheduler() |
ActorRef |
systemActorOf(Props props,
java.lang.String name)
Create an actor in the "/system" namespace.
|
LocalActorRef |
systemGuardian()
The top-level supervisor of all system-internal services like logging.
|
protected ActorSystemImpl |
systemImpl()
INTERNAL API
|
scala.concurrent.Future<scala.runtime.BoxedUnit> |
terminationFuture() |
akka.dispatch.MonitorableThreadFactory |
threadFactory()
A ThreadFactory that can be used if the transport needs to create any Threads
|
java.lang.String |
toString() |
protected java.lang.Thread.UncaughtExceptionHandler |
uncaughtExceptionHandler() |
apply, apply, apply, apply, apply, child, create, create, create, create, create, descendant, EnvHome, findClassLoader, GlobalHome, startTime, SystemHome, uptime, Versionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitactorFor, actorFor, actorFor, actorFor, actorSelection, actorSelectionpublic ActorSystemImpl(java.lang.String name,
com.typesafe.config.Config applicationConfig,
java.lang.ClassLoader classLoader,
scala.Option<scala.concurrent.ExecutionContext> defaultExecutionContext)
public java.lang.String name()
ActorSystemname in class ActorSystempublic final ActorSystem.Settings settings()
ActorSystemsettings in class ActorSystemprotected java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler()
public final akka.dispatch.MonitorableThreadFactory threadFactory()
ExtendedActorSystemthreadFactory in class ExtendedActorSystemprotected DynamicAccess createDynamicAccess()
public DynamicAccess dynamicAccess()
ExtendedActorSystemdynamicAccess in class ExtendedActorSystempublic void logConfiguration()
ActorSystemlogConfiguration in class ActorSystemprotected ActorSystemImpl systemImpl()
ActorRefFactorypublic ActorRef systemActorOf(Props props, java.lang.String name)
ExtendedActorSystemsystemActorOf in class ExtendedActorSystemprops - (undocumented)name - (undocumented)public ActorRef actorOf(Props props, java.lang.String name)
ActorRefFactoryInvalidActorNameException is thrown.
See Props for details on how to obtain a Props object.
props - (undocumented)name - (undocumented)public ActorRef actorOf(Props props)
ActorRefFactory
See Props for details on how to obtain a Props object.
props - (undocumented)public void stop(ActorRef actor)
ActorRefFactoryActorRef; this is
an asynchronous operation, i.e. involves a message send.
If this method is applied to the self reference from inside an Actor
then that Actor is guaranteed to not process any further messages after
this call; please note that the processing of the current message will
continue, this method does not immediately terminate this actor.actor - (undocumented)public akka.event.EventStream eventStream()
ActorSystemeventStream in class ActorSystempublic akka.event.LoggingAdapter log()
ActorSystemActorSystem.eventStream.log in class ActorSystempublic Scheduler scheduler()
ActorSystemscheduler in class ActorSystempublic ActorRefProvider provider()
ExtendedActorSystemprovider in interface ActorRefFactoryprovider in class ExtendedActorSystempublic ActorRef deadLetters()
ActorSystemdeadLetters in class ActorSystempublic akka.dispatch.Mailboxes mailboxes()
ActorSystemmailboxes in class ActorSystempublic akka.dispatch.Dispatchers dispatchers()
ActorSystemdispatchers in class ActorSystempublic scala.concurrent.ExecutionContextExecutor dispatcher()
ActorSystemdispatcher in interface ActorRefFactorydispatcher in class ActorSystempublic scala.concurrent.ExecutionContext internalCallingThreadExecutionContext()
public scala.concurrent.Future<scala.runtime.BoxedUnit> terminationFuture()
public InternalActorRef lookupRoot()
ActorRefFactorypublic LocalActorRef guardian()
ExtendedActorSystemguardian in interface ActorRefFactoryguardian in class ExtendedActorSystempublic LocalActorRef systemGuardian()
ExtendedActorSystemsystemGuardian in class ExtendedActorSystempublic ActorSystemImpl start()
public <T> void registerOnTermination(scala.Function0<T> code)
ActorSystemregisterOnTermination in class ActorSystemcode - (undocumented)public void registerOnTermination(java.lang.Runnable code)
ActorSystemregisterOnTermination in class ActorSystemcode - (undocumented)public void awaitTermination(scala.concurrent.duration.Duration timeout)
ActorSystemawaitTermination in class ActorSystemtimeout - (undocumented)public void awaitTermination()
ActorSystemawaitTermination in class ActorSystempublic boolean isTerminated()
ActorSystemawaitTermination(0 seconds) would return normally. If this method
returns false, the status is actually unknown, since it might have
changed since you queried it.isTerminated in class ActorSystempublic void shutdown()
ActorSystemActorSystem.registerOnTermination).shutdown in class ActorSystempublic boolean aborting()
public void abort()
protected Scheduler createScheduler()
Furthermore, this timer service MUST throw IllegalStateException if it cannot schedule a task. Once scheduled, the task MUST be executed. If executed upon close(), the task may execute before its timeout.
protected void stopScheduler()
public final <T extends Extension> T registerExtension(ExtensionId<T> ext)
ActorSystemregisterExtension in class ActorSystemext - (undocumented)public <T extends Extension> T extension(ExtensionId<T> ext)
ActorSystemextension in class ActorSystemext - (undocumented)public boolean hasExtension(ExtensionId<? extends Extension> ext)
ActorSystemhasExtension in class ActorSystemext - (undocumented)public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String printTree()
ExtendedActorSystemprintTree in class ExtendedActorSystem