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 ActorContextactorContext()scala.collection.immutable.Iterable<ActorRef>children()InternalActorRefgetChild(scala.collection.Iterator<java.lang.String> names)Obtain ActorRef by possibly traversing the actor tree or looking it up at some provider-specific location.InternalActorRefgetParent()Obtain parent of this ref; used by getChild for ".." paths.InternalActorRefgetSingleChild(java.lang.String name)Method for looking up a single child beneath this actor.booleanisTerminated()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 ActorCellnewActorCell(ActorSystemImpl system, InternalActorRef ref, Props props, MessageDispatcher dispatcher, InternalActorRef supervisor)ActorPathpath()ActorRefProviderprovider()Get a reference to the actor ref provider which created this ref.voidrestart(java.lang.Throwable cause)voidresume(java.lang.Throwable causedByFailure)Resumes a suspended actor.voidsendSystemMessage(SystemMessage message)voidstart()Starts the actor after initialization.voidstop()Shuts down the actor and its message queuevoidsuspend()Suspends the actor so that it will not process messages until resumed.ActorCellunderlying()protected java.lang.ObjectwriteReplace()-
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:
$bangin interfaceScalaActorRef
-
$bang$default$2
public ActorRef $bang$default$2(java.lang.Object message)
- Specified by:
$bang$default$2in interfaceScalaActorRef
-
actorContext
protected ActorContext actorContext()
-
children
public scala.collection.immutable.Iterable<ActorRef> children()
- Specified by:
childrenin classActorRefWithCell
-
getChild
public InternalActorRef getChild(scala.collection.Iterator<java.lang.String> names)
Description copied from class:InternalActorRefObtain 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:
getChildin classInternalActorRef- Parameters:
names- (undocumented)- Returns:
- (undocumented)
-
getParent
public InternalActorRef getParent()
Description copied from class:InternalActorRefObtain parent of this ref; used by getChild for ".." paths.- Specified by:
getParentin 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:
getSingleChildin 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:
isTerminatedin 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:InternalActorRefGet a reference to the actor ref provider which created this ref.- Specified by:
providerin classInternalActorRef- Returns:
- (undocumented)
-
restart
public void restart(java.lang.Throwable cause)
- Specified by:
restartin classInternalActorRef
-
resume
public void resume(java.lang.Throwable causedByFailure)
Resumes a suspended actor.- Specified by:
resumein classInternalActorRef- Parameters:
causedByFailure- (undocumented)
-
sendSystemMessage
public void sendSystemMessage(SystemMessage message)
- Specified by:
sendSystemMessagein classInternalActorRef
-
start
public void start()
Starts the actor after initialization.- Specified by:
startin classInternalActorRef
-
stop
public void stop()
Shuts down the actor and its message queue- Specified by:
stopin 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:
suspendin classInternalActorRef
-
underlying
public ActorCell underlying()
- Specified by:
underlyingin classActorRefWithCell
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
-