Class ActorSystemAdapter<T>
- java.lang.Object
-
- akka.actor.typed.ActorSystem<T>
-
- akka.actor.typed.internal.adapter.ActorSystemAdapter<T>
-
- All Implemented Interfaces:
ClassicActorSystemProvider
,ActorRef<T>
,Extensions
,ActorRefImpl<T>
,ExtensionsImpl
,InternalRecipientRef<T>
,RecipientRef<T>
,java.io.Serializable
,java.lang.Comparable<ActorRef<?>>
public class ActorSystemAdapter<T> extends ActorSystem<T> implements ActorRef<T>, ActorRefImpl<T>, InternalRecipientRef<T>, ExtensionsImpl
INTERNAL API. Lightweight wrapper for presenting an untyped ActorSystem to a Behavior (via the context). Therefore it does not have a lot of vals, only the whenTerminated Future is cached after its transformation because redoing that every time will add extra objects that persist for a longer time; in all other cases the wrapper will just be spawned for a single call in most circumstances.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActorSystemAdapter.AdapterExtension
static class
ActorSystemAdapter.AdapterExtension$
static class
ActorSystemAdapter.LoadTypedExtensions
static class
ActorSystemAdapter.LoadTypedExtensions$
-
Nested classes/interfaces inherited from interface akka.actor.typed.ActorRef
ActorRef.ActorRefOps<T>, ActorRef.ActorRefOps$
-
Nested classes/interfaces inherited from interface akka.actor.typed.RecipientRef
RecipientRef.RecipientRefOps<T>, RecipientRef.RecipientRefOps$
-
-
Constructor Summary
Constructors Constructor Description ActorSystemAdapter(ActorSystemImpl untypedSystem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ActorSystem<scala.runtime.Nothing$>
apply(ActorSystem system)
ActorSystem
classicSystem()
<U> ActorRef<U>
deadLetters()
The deadLetter address is a destination that will accept (and discard) every message sent to it.Dispatchers
dispatchers()
Facilities for lookup up thread-pools from configuration.DynamicAccess
dynamicAccess()
ClassLoader wrapper which is used for reflective accesses internally.scala.concurrent.ExecutionContextExecutor
executionContext()
The default thread pool of this ActorSystem, configured with settings inakka.actor.default-dispatcher
.java.util.concurrent.CompletionStage<Done>
getWhenTerminated()
Java API: Returns a CompletionStage which will be completed after the ActorSystem has been terminated and termination hooks have been executed.boolean
isLocal()
boolean
isTerminated()
Logger
log()
ALogger
that can be used to emit log messages without specifying a more detailed source.void
logConfiguration()
Log the configuration.java.lang.String
name()
ActorPath
path()
The hierarchical path name of the referenced Actor.java.lang.String
printTree()
Create a string representation of the actor hierarchy within this system for debugging purposes.ActorRefProvider
provider()
Get a reference to the actor ref provider which created this ref.Scheduler
scheduler()
A generic scheduler that can initiate the execution of tasks after some delay.void
sendSystem(SystemMessage signal)
Settings
settings()
The core settings extracted from the supplied configuration.long
startTime()
Start-up time in milliseconds since the epoch.<U> scala.concurrent.Future<ActorRef<U>>
systemActorOf(Behavior<U> behavior, java.lang.String name, Props props, Timeout timeout)
Create an actor in the "/system" namespace.void
tell(T msg)
Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.void
terminate()
Terminates this actor system.java.util.concurrent.ThreadFactory
threadFactory()
A ThreadFactory that can be used if the transport needs to create any Threadsstatic <U> ActorSystem
toClassic(ActorSystem<?> sys)
java.lang.String
toString()
ActorSystemImpl
untypedSystem()
long
uptime()
Up-time of this actor system in seconds.scala.concurrent.Future<Done>
whenTerminated()
Scala API: Returns a Future which will be completed after the ActorSystem has been terminated and termination hooks have been executed.-
Methods inherited from class akka.actor.typed.ActorSystem
apply, apply, apply, apply, apply$default$4, create, create, create, create, receptionist, systemActorOf$default$3, wrap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.actor.typed.ActorRef
writeReplace
-
Methods inherited from interface akka.actor.typed.internal.ActorRefImpl
compareTo, equals, hashCode, narrow, unsafeUpcast
-
Methods inherited from interface akka.actor.typed.internal.ExtensionsImpl
createExtensionInstance, extension, findExtension, hasExtension, loadExtensions, registerExtension
-
-
-
-
Constructor Detail
-
ActorSystemAdapter
public ActorSystemAdapter(ActorSystemImpl untypedSystem)
-
-
Method Detail
-
apply
public static ActorSystem<scala.runtime.Nothing$> apply(ActorSystem system)
-
toClassic
public static <U> ActorSystem toClassic(ActorSystem<?> sys)
-
untypedSystem
public ActorSystemImpl untypedSystem()
-
classicSystem
public ActorSystem classicSystem()
- Specified by:
classicSystem
in interfaceClassicActorSystemProvider
-
tell
public void tell(T msg)
Description copied from interface:ActorRef
Send a message to the Actor referenced by this ActorRef using *at-most-once* messaging semantics.
-
isLocal
public boolean isLocal()
- Specified by:
isLocal
in interfaceActorRefImpl<T>
-
sendSystem
public void sendSystem(SystemMessage signal)
- Specified by:
sendSystem
in interfaceActorRefImpl<T>
-
provider
public ActorRefProvider provider()
Description copied from interface:InternalRecipientRef
Get a reference to the actor ref provider which created this ref.- Specified by:
provider
in interfaceInternalRecipientRef<T>
- Returns:
- (undocumented)
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfaceInternalRecipientRef<T>
- Returns:
true
if the actor is locally known to be terminated,false
if alive or uncertain.
-
path
public final ActorPath path()
Description copied from interface:ActorRef
The hierarchical path name of the referenced Actor. The lifecycle of the ActorRef is fully contained within the lifecycle of theActorPath
and more than one Actor instance can exist with the same path at different points in time, but not concurrently.
-
toString
public java.lang.String toString()
- Specified by:
toString
in interfaceActorRefImpl<T>
- Overrides:
toString
in classjava.lang.Object
-
deadLetters
public <U> ActorRef<U> deadLetters()
Description copied from class:ActorSystem
The deadLetter address is a destination that will accept (and discard) every message sent to it.- Specified by:
deadLetters
in classActorSystem<T>
- Returns:
- (undocumented)
-
dispatchers
public Dispatchers dispatchers()
Description copied from class:ActorSystem
Facilities for lookup up thread-pools from configuration.- Specified by:
dispatchers
in classActorSystem<T>
- Returns:
- (undocumented)
-
dynamicAccess
public DynamicAccess dynamicAccess()
Description copied from class:ActorSystem
ClassLoader wrapper which is used for reflective accesses internally. This is set to use the context class loader, if one is set, or the class loader which loaded the ActorSystem implementation. The context class loader is also set on all threads created by the ActorSystem, if one was set during creation.- Specified by:
dynamicAccess
in classActorSystem<T>
- Returns:
- (undocumented)
-
executionContext
public scala.concurrent.ExecutionContextExecutor executionContext()
Description copied from class:ActorSystem
The default thread pool of this ActorSystem, configured with settings inakka.actor.default-dispatcher
.- Specified by:
executionContext
in classActorSystem<T>
- Returns:
- (undocumented)
-
log
public Logger log()
Description copied from class:ActorSystem
ALogger
that can be used to emit log messages without specifying a more detailed source. Typically it is desirable to use the dedicatedLogger
available from each Actor’sTypedActorContext
as that ties the log entries to the actor.- Specified by:
log
in classActorSystem<T>
- Returns:
- (undocumented)
-
logConfiguration
public void logConfiguration()
Description copied from class:ActorSystem
Log the configuration.- Specified by:
logConfiguration
in classActorSystem<T>
-
name
public java.lang.String name()
- Specified by:
name
in classActorSystem<T>
-
scheduler
public Scheduler scheduler()
Description copied from class:ActorSystem
A generic scheduler that can initiate the execution of tasks after some delay. It is recommended to use the ActorContext’s scheduling capabilities for sending messages to actors instead of registering a Runnable for execution using this facility.- Specified by:
scheduler
in classActorSystem<T>
- Returns:
- (undocumented)
-
settings
public Settings settings()
Description copied from class:ActorSystem
The core settings extracted from the supplied configuration.- Specified by:
settings
in classActorSystem<T>
- Returns:
- (undocumented)
-
startTime
public long startTime()
Description copied from class:ActorSystem
Start-up time in milliseconds since the epoch.- Specified by:
startTime
in classActorSystem<T>
- Returns:
- (undocumented)
-
threadFactory
public java.util.concurrent.ThreadFactory threadFactory()
Description copied from class:ActorSystem
A ThreadFactory that can be used if the transport needs to create any Threads- Specified by:
threadFactory
in classActorSystem<T>
- Returns:
- (undocumented)
-
uptime
public long uptime()
Description copied from class:ActorSystem
Up-time of this actor system in seconds.- Specified by:
uptime
in classActorSystem<T>
- Returns:
- (undocumented)
-
printTree
public java.lang.String printTree()
Description copied from class:ActorSystem
Create a string representation of the actor hierarchy within this system for debugging purposes.The format of the string is subject to change, i.e. no stable “API”.
- Specified by:
printTree
in classActorSystem<T>
- Returns:
- (undocumented)
-
terminate
public void terminate()
Description copied from class:ActorSystem
Terminates 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).This is an asynchronous operation and completion of the termination can be observed with
ActorSystem.whenTerminated
orActorSystem.getWhenTerminated
.- Specified by:
terminate
in classActorSystem<T>
-
whenTerminated
public scala.concurrent.Future<Done> whenTerminated()
Description copied from class:ActorSystem
Scala API: Returns a Future which will be completed after the ActorSystem has been terminated and termination hooks have been executed. TheActorSystem
can be stopped withActorSystem.terminate
or by stopping the guardian actor.- Specified by:
whenTerminated
in classActorSystem<T>
- Returns:
- (undocumented)
-
getWhenTerminated
public java.util.concurrent.CompletionStage<Done> getWhenTerminated()
Description copied from class:ActorSystem
Java API: Returns a CompletionStage which will be completed after the ActorSystem has been terminated and termination hooks have been executed. TheActorSystem
can be stopped withActorSystem.terminate
or by stopping the guardian actor.- Specified by:
getWhenTerminated
in classActorSystem<T>
- Returns:
- (undocumented)
-
systemActorOf
public <U> scala.concurrent.Future<ActorRef<U>> systemActorOf(Behavior<U> behavior, java.lang.String name, Props props, Timeout timeout)
Description copied from class:ActorSystem
Create an actor in the "/system" namespace. This actor will be shut down during system.terminate only after all user actors have terminated.The returned Future of
ActorRef
may be converted into anActorRef
to which messages can immediately be sent by using theActorRef.apply
method.- Specified by:
systemActorOf
in classActorSystem<T>
- Parameters:
behavior
- (undocumented)name
- (undocumented)props
- (undocumented)timeout
- (undocumented)- Returns:
- (undocumented)
-
-