public class ActorSystemImpl extends ExtendedActorSystem
| Modifier and Type | Class and Description |
|---|---|
class |
ActorSystemImpl.TerminationCallbacks<T> |
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,
scala.Option<Props> guardianProps,
ActorSystemSetup setup) |
| 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.
|
Dispatchers |
dispatchers()
Helper object for looking up configured dispatchers.
|
DynamicAccess |
dynamicAccess()
ClassLoader wrapper which is used for reflective accesses internally.
|
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(...).
|
scala.Option<Props> |
guardianProps() |
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.
|
LoggingAdapter |
log()
Convenient logging adapter for logging to the
ActorSystem.eventStream(). |
void |
logConfiguration()
Log the configuration.
|
LoggingFilter |
logFilter()
Filter of log events that is used by the LoggingAdapter before
publishing log events to the eventStream
|
InternalActorRef |
lookupRoot()
INTERNAL API
|
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<Terminated> |
terminate()
Terminates this actor system.
|
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() |
scala.concurrent.Future<Terminated> |
whenTerminated()
Returns a Future which will be completed after the ActorSystem has been terminated
and termination hooks have been executed.
|
actorFor, actorFor, actorFor, actorFor, actorSelection, actorSelection, apply, apply, apply, apply, apply, apply, apply, child, create, create, 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,
scala.Option<Props> guardianProps,
ActorSystemSetup setup)
public java.lang.String name()
ActorSystemname in class ActorSystempublic scala.Option<Props> guardianProps()
public final ActorSystem.Settings settings()
ActorSystemsettings in class ActorSystemprotected java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler()
public final MonitorableThreadFactory threadFactory()
ExtendedActorSystemthreadFactory in class ExtendedActorSystemprotected DynamicAccess createDynamicAccess()
public DynamicAccess dynamicAccess()
ExtendedActorSystemdynamicAccess in class ExtendedActorSystempublic void logConfiguration()
ActorSystemlogConfiguration in class ActorSystemprotected ActorSystemImpl systemImpl()
ActorRefFactorysystemImpl in interface ActorRefFactorysystemImpl in class ActorSystempublic 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.
actorOf in interface ActorRefFactoryactorOf in class ActorSystemprops - (undocumented)name - (undocumented)public ActorRef actorOf(Props props)
ActorRefFactory
See Props for details on how to obtain a Props object.
actorOf in interface ActorRefFactoryactorOf in class ActorSystemprops - (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.stop in interface ActorRefFactorystop in class ActorSystemactor - (undocumented)public EventStream eventStream()
ActorSystemeventStream in class ActorSystempublic LoggingFilter logFilter()
ExtendedActorSystemlogFilter in class ExtendedActorSystempublic 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 Mailboxes mailboxes()
ActorSystemmailboxes in class ActorSystempublic 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<Terminated> whenTerminated()
ActorSystemdispatcher of this actor system as it will have been shut down before this
future completes.whenTerminated in class ActorSystempublic InternalActorRef lookupRoot()
ActorRefFactorylookupRoot in interface ActorRefFactorylookupRoot in class ActorSystempublic 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)
ActorSystemThrows a RejectedExecutionException if the System has already shut down or if shutdown has been initiated.
Scala API
registerOnTermination in class ActorSystemcode - (undocumented)public void registerOnTermination(java.lang.Runnable code)
ActorSystemThrows a RejectedExecutionException if the System has already shut down or if shutdown has been initiated.
registerOnTermination in class ActorSystemcode - (undocumented)public void awaitTermination(scala.concurrent.duration.Duration timeout)
ActorSystemThrows TimeoutException in case of timeout.
awaitTermination 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(scala.Function0<T>)).shutdown in class ActorSystempublic scala.concurrent.Future<Terminated> terminate()
ActorSystemActorSystem.registerOnTermination(scala.Function0<T>)).
Be careful to not schedule any operations on completion of the returned future
using the dispatcher of this actor system as it will have been shut down before the
future completes.terminate 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