akka.actor
Class LocalActorRef

java.lang.Object
  extended by akka.actor.ActorRef
      extended by akka.actor.InternalActorRef
          extended by akka.actor.ActorRefWithCell
              extended by akka.actor.LocalActorRef
All Implemented Interfaces:
ActorRefScope, LocalRef, ScalaActorRef, java.io.Serializable, java.lang.Comparable<ActorRef>
Direct Known Subclasses:
TestActorRef

public class LocalActorRef
extends ActorRefWithCell
implements LocalRef

Local (serializable) ActorRef that is used when referencing the Actor on its "home" node.

INTERNAL API

See Also:
Serialized Form

Constructor Summary
LocalActorRef(ActorSystemImpl _system, Props _props, MessageDispatcher _dispatcher, MailboxType _mailboxType, InternalActorRef _supervisor, ActorPath path)
           
 
Method Summary
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()
          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()
          Returns the path for this actor (from this actor up to the root actor).
 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 queue
 void 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface akka.actor.LocalRef
isLocal
 

Constructor Detail

LocalActorRef

public LocalActorRef(ActorSystemImpl _system,
                     Props _props,
                     MessageDispatcher _dispatcher,
                     MailboxType _mailboxType,
                     InternalActorRef _supervisor,
                     ActorPath path)
Method Detail

path

public ActorPath path()
Description copied from class: ActorRef
Returns the path for this actor (from this actor up to the root actor).

Specified by:
path in class ActorRef
Returns:
(undocumented)

newActorCell

protected ActorCell newActorCell(ActorSystemImpl system,
                                 InternalActorRef ref,
                                 Props props,
                                 MessageDispatcher dispatcher,
                                 InternalActorRef supervisor)

actorContext

protected ActorContext actorContext()

isTerminated

public boolean isTerminated()
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 class InternalActorRef
Returns:
(undocumented)

start

public void start()
Starts the actor after initialization.

Specified by:
start in class InternalActorRef

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 class InternalActorRef

resume

public void resume(java.lang.Throwable causedByFailure)
Resumes a suspended actor.

Specified by:
resume in class InternalActorRef
Parameters:
causedByFailure - (undocumented)

stop

public void stop()
Shuts down the actor and its message queue

Specified by:
stop in class InternalActorRef

getParent

public InternalActorRef getParent()
Description copied from class: InternalActorRef
Obtain parent of this ref; used by getChild for ".." paths.

Specified by:
getParent in class InternalActorRef
Returns:
(undocumented)

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 class InternalActorRef
Returns:
(undocumented)

children

public scala.collection.immutable.Iterable<ActorRef> children()
Specified by:
children in class ActorRefWithCell

getSingleChild

public InternalActorRef getSingleChild(java.lang.String name)
Method for looking up a single child beneath this actor. Override in order to inject &ldquo;synthetic&rdquo; actor paths like &ldquo;/temp&rdquo;. It is racy if called from the outside.

Specified by:
getSingleChild in class ActorRefWithCell
Parameters:
name - (undocumented)
Returns:
(undocumented)

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 class InternalActorRef
Parameters:
names - (undocumented)
Returns:
(undocumented)

underlying

public ActorCell underlying()
Specified by:
underlying in class ActorRefWithCell

sendSystemMessage

public void sendSystemMessage(SystemMessage message)
Specified by:
sendSystemMessage in class InternalActorRef

restart

public void restart(java.lang.Throwable cause)
Specified by:
restart in class InternalActorRef

writeReplace

protected java.lang.Object writeReplace()