Package akka.actor
Class RepointableActorRef
- java.lang.Object
-
- akka.actor.ActorRef
-
- akka.actor.InternalActorRef
-
- akka.actor.ActorRefWithCell
-
- akka.actor.RepointableActorRef
-
- All Implemented Interfaces:
ActorRefScope
,RepointableRef
,ScalaActorRef
,java.io.Serializable
,java.lang.Comparable<ActorRef>
,scala.Serializable
- Direct Known Subclasses:
RoutedActorRef
public class RepointableActorRef extends ActorRefWithCell implements RepointableRef
Initialize: make a dummy cell which holds just a mailbox, then tell our supervisor that we exist so that he can create the real Cell in handleSupervise().Call twice on your own peril!
This is protected so that others can have different initialization.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RepointableActorRef(ActorSystemImpl system, Props props, MessageDispatcher dispatcher, MailboxType mailboxType, InternalActorRef supervisor, ActorPath path)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
$bang(java.lang.Object message, ActorRef sender)
ActorRef
$bang$default$2(java.lang.Object message)
scala.collection.immutable.Iterable<ActorRef>
children()
MessageDispatcher
dispatcher()
InternalActorRef
getChild(scala.collection.Iterator<java.lang.String> name)
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.RepointableActorRef
initialize(boolean async)
Initialize: make a dummy cell which holds just a mailbox, then tell our supervisor that we exist so that he can create the real Cell in handleSupervise().boolean
isLocal()
Scope: if this ref points to an actor which resides within the same JVM, i.e.boolean
isStarted()
boolean
isTerminated()
Deprecated.Use context.watch(actor) and receive Terminated(actor).Cell
lookup()
MailboxType
mailboxType()
Cell
newCell(UnstartedCell old)
This is called by activate() to obtain the cell which is to replace the unstarted cell.ActorPath
path()
RepointableActorRef
point(boolean catchFailures)
This method is supposed to be called by the supervisor in handleSupervise() to replace the UnstartedCell with the real one.Props
props()
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)
void
sendSystemMessage(SystemMessage message)
void
start()
void
stop()
InternalActorRef
supervisor()
void
suspend()
Cell
swapCell(Cell next)
Cell
swapLookup(Cell next)
ActorSystemImpl
system()
Cell
underlying()
protected java.lang.Object
writeReplace()
-
-
-
Constructor Detail
-
RepointableActorRef
public RepointableActorRef(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
-
children
public scala.collection.immutable.Iterable<ActorRef> children()
- Specified by:
children
in classActorRefWithCell
-
dispatcher
public MessageDispatcher dispatcher()
-
getChild
public InternalActorRef getChild(scala.collection.Iterator<java.lang.String> name)
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:
name
- (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. It is racy if called from the outside.- Specified by:
getSingleChild
in classActorRefWithCell
- Parameters:
name
- (undocumented)- Returns:
- (undocumented)
-
initialize
public RepointableActorRef initialize(boolean async)
Initialize: make a dummy cell which holds just a mailbox, then tell our supervisor that we exist so that he can create the real Cell in handleSupervise().Call twice on your own peril!
This is protected so that others can have different initialization.
- Parameters:
async
- (undocumented)- Returns:
- (undocumented)
-
isLocal
public boolean isLocal()
Description copied from class:InternalActorRef
Scope: if this ref points to an actor which resides within the same JVM, i.e. whose mailbox is directly reachable etc.- Specified by:
isLocal
in interfaceActorRefScope
- Specified by:
isLocal
in classInternalActorRef
- Returns:
- (undocumented)
-
isStarted
public boolean isStarted()
- Specified by:
isStarted
in interfaceRepointableRef
-
isTerminated
public boolean isTerminated()
Deprecated.Use context.watch(actor) and receive Terminated(actor). Since 2.2.Description copied from class:InternalActorRef
INTERNAL API: Returns “true” if the actor is locally known to be terminated, “false” if alive or uncertain.- Specified by:
isTerminated
in classInternalActorRef
- Returns:
- (undocumented)
-
lookup
public Cell lookup()
-
mailboxType
public MailboxType mailboxType()
-
newCell
public Cell newCell(UnstartedCell old)
This is called by activate() to obtain the cell which is to replace the unstarted cell. The cell must be fully functional.- Parameters:
old
- (undocumented)- Returns:
- (undocumented)
-
point
public RepointableActorRef point(boolean catchFailures)
This method is supposed to be called by the supervisor in handleSupervise() to replace the UnstartedCell with the real one. It assumes no concurrent modification of theunderlying
field, though it is safe to send messages at any time.- Parameters:
catchFailures
- (undocumented)- Returns:
- (undocumented)
-
props
public Props props()
-
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)
- Specified by:
resume
in classInternalActorRef
-
sendSystemMessage
public void sendSystemMessage(SystemMessage message)
- Specified by:
sendSystemMessage
in classInternalActorRef
-
start
public void start()
- Specified by:
start
in classInternalActorRef
-
stop
public void stop()
- Specified by:
stop
in classInternalActorRef
-
supervisor
public InternalActorRef supervisor()
-
suspend
public void suspend()
- Specified by:
suspend
in classInternalActorRef
-
system
public ActorSystemImpl system()
-
underlying
public Cell underlying()
- Specified by:
underlying
in classActorRefWithCell
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
-