Package akka.actor
Class LocalActorRef
- java.lang.Object
-
- akka.actor.ActorRef
-
- akka.actor.InternalActorRef
-
- akka.actor.ActorRefWithCell
-
- akka.actor.LocalActorRef
-
- All Implemented Interfaces:
ActorRefScope
,LocalRef
,ScalaActorRef
,java.io.Serializable
,java.lang.Comparable<ActorRef>
,scala.Serializable
- Direct Known Subclasses:
TestActorRef
public class LocalActorRef extends ActorRefWithCell implements LocalRef
INTERNAL API: Is the actor terminated? If this method returns true, it will never return false again, but if it returns false, you cannot be sure if it's alive still (race condition)- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LocalActorRef(ActorSystemImpl _system, Props _props, MessageDispatcher _dispatcher, MailboxType _mailboxType, InternalActorRef _supervisor, ActorPath path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
$bang(java.lang.Object message, ActorRef sender)
ActorRef
$bang$default$2(java.lang.Object message)
protected ActorContext
actorContext()
scala.collection.immutable.Iterable<ActorRef>
children()
InternalActorRef
getChild(scala.collection.Iterator<java.lang.String> names)
Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location.InternalActorRef
getParent()
Obtain parent of this ref; used by getChild for ".." paths.InternalActorRef
getSingleChild(java.lang.String name)
Method for looking up a single child beneath this actor.boolean
isTerminated()
INTERNAL API: Is the actor terminated? If this method returns true, it will never return false again, but if it returns false, you cannot be sure if it's alive still (race condition)protected ActorCell
newActorCell(ActorSystemImpl system, InternalActorRef ref, Props props, MessageDispatcher dispatcher, InternalActorRef supervisor)
ActorPath
path()
ActorRefProvider
provider()
Get a reference to the actor ref provider which created this ref.void
restart(java.lang.Throwable cause)
void
resume(java.lang.Throwable causedByFailure)
Resumes a suspended actor.void
sendSystemMessage(SystemMessage message)
void
start()
Starts the actor after initialization.void
stop()
Shuts down the actor and its message queuevoid
suspend()
Suspends the actor so that it will not process messages until resumed.ActorCell
underlying()
protected java.lang.Object
writeReplace()
-
Methods inherited from class akka.actor.InternalActorRef
isLocal
-
Methods inherited from class akka.actor.ActorRef
compareTo, equals, forward, hashCode, noSender, tell, toString
-
-
-
-
Constructor Detail
-
LocalActorRef
public LocalActorRef(ActorSystemImpl _system, Props _props, MessageDispatcher _dispatcher, MailboxType _mailboxType, InternalActorRef _supervisor, ActorPath path)
-
-
Method Detail
-
$bang
public void $bang(java.lang.Object message, ActorRef sender)
- Specified by:
$bang
in interfaceScalaActorRef
-
$bang$default$2
public ActorRef $bang$default$2(java.lang.Object message)
- Specified by:
$bang$default$2
in interfaceScalaActorRef
-
actorContext
protected ActorContext actorContext()
-
children
public scala.collection.immutable.Iterable<ActorRef> children()
- Specified by:
children
in classActorRefWithCell
-
getChild
public InternalActorRef getChild(scala.collection.Iterator<java.lang.String> names)
Description copied from class:InternalActorRef
Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location. This method shall return the end result, i.e. not only the next step in the look-up; this will typically involve recursive invocation. A path element of ".." signifies the parent, a trailing "" element must be disregarded. If the requested path does not exist, return Nobody.- Specified by:
getChild
in classInternalActorRef
- Parameters:
names
- (undocumented)- Returns:
- (undocumented)
-
getParent
public InternalActorRef getParent()
Description copied from class:InternalActorRef
Obtain parent of this ref; used by getChild for ".." paths.- Specified by:
getParent
in classInternalActorRef
- Returns:
- (undocumented)
-
getSingleChild
public InternalActorRef getSingleChild(java.lang.String name)
Method for looking up a single child beneath this actor. Override in order to inject “synthetic” actor paths like “/temp”. It is racy if called from the outside.- Specified by:
getSingleChild
in classActorRefWithCell
- Parameters:
name
- (undocumented)- Returns:
- (undocumented)
-
isTerminated
public boolean isTerminated()
INTERNAL API: Is the actor terminated? If this method returns true, it will never return false again, but if it returns false, you cannot be sure if it's alive still (race condition)- Specified by:
isTerminated
in classInternalActorRef
- Returns:
- (undocumented)
-
newActorCell
protected ActorCell newActorCell(ActorSystemImpl system, InternalActorRef ref, Props props, MessageDispatcher dispatcher, InternalActorRef supervisor)
-
provider
public ActorRefProvider provider()
Description copied from class:InternalActorRef
Get a reference to the actor ref provider which created this ref.- Specified by:
provider
in classInternalActorRef
- Returns:
- (undocumented)
-
restart
public void restart(java.lang.Throwable cause)
- Specified by:
restart
in classInternalActorRef
-
resume
public void resume(java.lang.Throwable causedByFailure)
Resumes a suspended actor.- Specified by:
resume
in classInternalActorRef
- Parameters:
causedByFailure
- (undocumented)
-
sendSystemMessage
public void sendSystemMessage(SystemMessage message)
- Specified by:
sendSystemMessage
in classInternalActorRef
-
start
public void start()
Starts the actor after initialization.- Specified by:
start
in classInternalActorRef
-
stop
public void stop()
Shuts down the actor and its message queue- Specified by:
stop
in classInternalActorRef
-
suspend
public void suspend()
Suspends the actor so that it will not process messages until resumed. The suspend request is processed asynchronously to the caller of this method as well as to normal message sends: the only ordering guarantee is that message sends done from the same thread after calling this method will not be processed until resumed.- Specified by:
suspend
in classInternalActorRef
-
underlying
public ActorCell underlying()
- Specified by:
underlying
in classActorRefWithCell
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
-