Class ActorCell
- java.lang.Object
-
- akka.actor.ActorCell
-
- All Implemented Interfaces:
AbstractActor.ActorContext
,ActorContext
,ActorRefFactory
,Cell
,ClassicActorContextProvider
,Children
,DeathWatch
,Dispatch
,FaultHandling
,ReceiveTimeout
,UntypedActorContext
- Direct Known Subclasses:
RoutedActorCell
public class ActorCell extends java.lang.Object implements UntypedActorContext, AbstractActor.ActorContext, Cell, ReceiveTimeout, Children, Dispatch, DeathWatch, FaultHandling
Everything in here is completely Akka PRIVATE. You will not find any supported APIs in this place. This is not the API you were looking for! (waves hand)
-
-
Constructor Summary
Constructors Constructor Description ActorCell(ActorSystemImpl system, InternalActorRef self, Props props, MessageDispatcher dispatcher, InternalActorRef parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Actor
actor()
protected void
actor_$eq(Actor a)
void
autoReceiveMessage(Envelope msg)
void
become(Procedure<java.lang.Object> behavior)
Changes the Actor's behavior to become the new 'Procedure' handler.void
become(Procedure<java.lang.Object> behavior, boolean discardOld)
Changes the Actor's behavior to become the new 'Procedure' handler.void
become(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> behavior, boolean discardOld)
Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler.boolean
become$default$2()
ActorContext
classicActorContext()
protected java.lang.Class<?>
clazz(java.lang.Object o)
protected void
clearActorCellFields(ActorCell cell)
protected void
clearActorFields(Actor actorInstance, boolean recreate)
static java.lang.ThreadLocal<scala.collection.immutable.List<ActorContext>>
contextStack()
protected void
create(scala.Option<ActorInitializationException> failure)
Envelope
currentMessage()
void
currentMessage_$eq(Envelope x$1)
static int
DefaultState()
MessageDispatcher
dispatcher()
Returns the dispatcher (MessageDispatcher) that is used for this Actor.static scala.collection.immutable.Set<ActorRef>
emptyActorRefSet()
static scala.collection.immutable.List<scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>>
emptyBehaviorStack()
static Cancellable
emptyCancellable()
scala.concurrent.ExecutionContextExecutor
getDispatcher()
Returns the dispatcher (MessageDispatcher) that is used for this Actor.InternalActorRef
getParent()
Returns the supervisor of this actor.Props
getProps()
Retrieve the Props which were used to create this actor.ActorRef
getSelf()
The ActorRef representing this actorActorSystemImpl
getSystem()
Returns the system this actor is running in.protected InternalActorRef
guardian()
Father of all children created by this interface.protected void
handleSupervise(ActorRef child, boolean async)
void
invoke(Envelope messageHandle)
boolean
isLocal()
Returns true if the actor is local, i.e.protected InternalActorRef
lookupRoot()
INTERNAL APIprotected Actor
newActor()
static int
newUid()
InternalActorRef
parent()
Returns the supervising parent ActorRef.Props
props()
Retrieve the Props which were used to create this actor.ActorRefProvider
provider()
INTERNAL APIprotected void
publish(Logging.LogEvent e)
void
receiveMessage(java.lang.Object msg)
InternalActorRef
self()
The ActorRef representing this actorActorRef
sender()
Returns the sender 'ActorRef' of the current message.protected void
setActorFields(Actor actorInstance, ActorContext context, ActorRef self)
static scala.Tuple2<java.lang.String,java.lang.Object>
splitNameAndUid(java.lang.String name)
protected void
stash(SystemMessage msg)
static int
SuspendedState()
static int
SuspendedWaitForChildrenState()
ActorSystemImpl
system()
The system that the actor belongs to.ActorSystemImpl
systemImpl()
INTERNAL APIvoid
systemInvoke(SystemMessage message)
static Props
terminatedProps()
protected int
uid()
void
unbecome()
Reverts the Actor behavior to the previous one on the behavior stack.static int
undefinedUid()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.actor.AbstractActor.ActorContext
become, become, cancelReceiveTimeout, findChild, getChild, getChildren, getReceiveTimeout, getSender, setReceiveTimeout
-
Methods inherited from interface akka.actor.ActorContext
become, child, children, receiveTimeout, setReceiveTimeout, unwatch, watch, watchWith, writeObject
-
Methods inherited from interface akka.actor.ActorRefFactory
actorFor, actorFor, actorFor, actorFor, actorOf, actorOf, actorSelection, actorSelection, stop
-
Methods inherited from interface akka.actor.Cell
childrenRefs, getChildByName, getSingleChild, hasMessages, isTerminated, numberOfMessages, restart, resume, sendMessage, sendMessage, sendSystemMessage, start, stop, suspend
-
Methods inherited from interface akka.actor.dungeon.Children
_childrenRefsDoNotCallMeDirectly_$eq, _functionRefsDoNotCallMeDirectly_$eq, _nextNameDoNotCallMeDirectly_$eq, actorOf, actorOf, addFunctionRef, addFunctionRef$default$2, attachChild, attachChild, checkName, child, children, childrenRefs, findChild, functionRefs, getAllChildStats, getChild, getChildByName, getChildByRef, getChildren, getFunctionRefOrNobody, getFunctionRefOrNobody$default$2, getSingleChild, initChild, isNormal, isTerminating, makeChild, randomName, randomName, removeChildAndGetStateChange, removeFunctionRef, reserveChild, resumeChildren, setChildrenTerminationReason, setTerminated, stop, stopFunctionRefs, suspendChildren, suspendChildren$default$1, swapChildrenRefs, unreserveChild, waitingForChildrenOrNull
-
Methods inherited from interface akka.actor.dungeon.DeathWatch
addressTerminated, addWatcher, checkWatchingSame, isWatching, maintainAddressTerminatedSubscription, maintainAddressTerminatedSubscription$default$1, receivedTerminated, removeFromMap, remWatcher, subscribeAddressTerminated, tellWatchersWeDied, terminatedQueued_$eq, terminatedQueuedFor, unsubscribeAddressTerminated, unwatch, unwatchWatchedActors, updateWatching, watch, watchedActorTerminated, watchedBy_$eq, watching_$eq, watchingContains, watchingGet, watchWith
-
Methods inherited from interface akka.actor.dungeon.Dispatch
_mailboxDoNotCallMeDirectly_$eq, handleException, hasMessages, init, initWithFailure, isTerminated, mailbox, numberOfMessages, restart, resume, sendMessage, sendSystemMessage, serializeAndDeserialize, serializeAndDeserializePayload, start, stop, suspend, swapMailbox
-
Methods inherited from interface akka.actor.dungeon.FaultHandling
_failed_$eq, clearFailed, faultCreate, faultRecreate, faultResume, faultSuspend, finishCreate, finishRecreate, finishTerminate, handleChildTerminated, handleFailure, handleInvokeFailure, handleNonFatalOrInterruptedException, isFailed, perpetrator, resumeNonRecursive, setFailed, suspendNonRecursive, terminate
-
Methods inherited from interface akka.actor.dungeon.ReceiveTimeout
cancelReceiveTimeout, checkReceiveTimeout, checkReceiveTimeout$default$1, receiveTimeout, receiveTimeoutData_$eq, rescheduleReceiveTimeout, setReceiveTimeout
-
Methods inherited from interface akka.actor.UntypedActorContext
getChild, getChildren
-
-
-
-
Constructor Detail
-
ActorCell
public ActorCell(ActorSystemImpl system, InternalActorRef self, Props props, MessageDispatcher dispatcher, InternalActorRef parent)
-
-
Method Detail
-
contextStack
public static java.lang.ThreadLocal<scala.collection.immutable.List<ActorContext>> contextStack()
-
emptyCancellable
public static final Cancellable emptyCancellable()
-
emptyBehaviorStack
public static final scala.collection.immutable.List<scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit>> emptyBehaviorStack()
-
emptyActorRefSet
public static final scala.collection.immutable.Set<ActorRef> emptyActorRefSet()
-
terminatedProps
public static final Props terminatedProps()
-
undefinedUid
public static final int undefinedUid()
-
newUid
public static final int newUid()
-
splitNameAndUid
public static final scala.Tuple2<java.lang.String,java.lang.Object> splitNameAndUid(java.lang.String name)
-
DefaultState
public static final int DefaultState()
-
SuspendedState
public static final int SuspendedState()
-
SuspendedWaitForChildrenState
public static final int SuspendedWaitForChildrenState()
-
system
public ActorSystemImpl system()
Description copied from interface:ActorContext
The system that the actor belongs to. Importing this member will place an implicit ActorSystem in scope.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
system
in interfaceActorContext
- Specified by:
system
in interfaceCell
- Returns:
- (undocumented)
-
self
public InternalActorRef self()
Description copied from interface:ActorContext
The ActorRef representing this actorThis method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
self
in interfaceActorContext
- Specified by:
self
in interfaceCell
- Returns:
- (undocumented)
-
props
public final Props props()
Description copied from interface:ActorContext
Retrieve the Props which were used to create this actor.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
props
in interfaceActorContext
- Specified by:
props
in interfaceCell
- Returns:
- (undocumented)
-
dispatcher
public MessageDispatcher dispatcher()
Description copied from interface:ActorContext
Returns the dispatcher (MessageDispatcher) that is used for this Actor. Importing this member will place an implicit ExecutionContext in scope.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
dispatcher
in interfaceActorContext
- Specified by:
dispatcher
in interfaceActorRefFactory
- Returns:
- (undocumented)
-
parent
public InternalActorRef parent()
Description copied from interface:ActorContext
Returns the supervising parent ActorRef.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
parent
in interfaceActorContext
- Specified by:
parent
in interfaceCell
- Returns:
- (undocumented)
-
isLocal
public final boolean isLocal()
Description copied from interface:Cell
Returns true if the actor is local, i.e. if it is actually scheduled on a Thread in the current JVM when run.
-
systemImpl
public final ActorSystemImpl systemImpl()
Description copied from interface:ActorRefFactory
INTERNAL API- Specified by:
systemImpl
in interfaceActorRefFactory
- Specified by:
systemImpl
in interfaceCell
- Returns:
- (undocumented)
-
guardian
protected final InternalActorRef guardian()
Description copied from interface:ActorRefFactory
Father of all children created by this interface.INTERNAL API
- Specified by:
guardian
in interfaceActorRefFactory
- Returns:
- (undocumented)
-
lookupRoot
protected final InternalActorRef lookupRoot()
Description copied from interface:ActorRefFactory
INTERNAL API- Specified by:
lookupRoot
in interfaceActorRefFactory
- Returns:
- (undocumented)
-
provider
public final ActorRefProvider provider()
Description copied from interface:ActorRefFactory
INTERNAL API- Specified by:
provider
in interfaceActorRefFactory
- Returns:
- (undocumented)
-
classicActorContext
public final ActorContext classicActorContext()
- Specified by:
classicActorContext
in interfaceClassicActorContextProvider
-
uid
protected int uid()
-
actor
public Actor actor()
-
actor_$eq
protected void actor_$eq(Actor a)
-
currentMessage
public Envelope currentMessage()
-
currentMessage_$eq
public void currentMessage_$eq(Envelope x$1)
-
getParent
public final InternalActorRef getParent()
Description copied from interface:AbstractActor.ActorContext
Returns the supervisor of this actor.Same as
parent()
.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
callbacks.- Specified by:
getParent
in interfaceAbstractActor.ActorContext
- Returns:
- (undocumented)
-
getSystem
public final ActorSystemImpl getSystem()
Description copied from interface:AbstractActor.ActorContext
Returns the system this actor is running in.Same as
system()
This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
callbacks.- Specified by:
getSystem
in interfaceAbstractActor.ActorContext
- Returns:
- (undocumented)
-
getDispatcher
public final scala.concurrent.ExecutionContextExecutor getDispatcher()
Description copied from interface:AbstractActor.ActorContext
Returns the dispatcher (MessageDispatcher) that is used for this Actor.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
getDispatcher
in interfaceAbstractActor.ActorContext
- Returns:
- (undocumented)
-
getSelf
public final ActorRef getSelf()
Description copied from interface:AbstractActor.ActorContext
The ActorRef representing this actorThis method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
getSelf
in interfaceAbstractActor.ActorContext
- Returns:
- (undocumented)
-
getProps
public final Props getProps()
Description copied from interface:AbstractActor.ActorContext
Retrieve the Props which were used to create this actor.This method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
getProps
in interfaceAbstractActor.ActorContext
- Returns:
- (undocumented)
-
stash
protected void stash(SystemMessage msg)
-
systemInvoke
public final void systemInvoke(SystemMessage message)
-
invoke
public final void invoke(Envelope messageHandle)
-
autoReceiveMessage
public void autoReceiveMessage(Envelope msg)
-
receiveMessage
public final void receiveMessage(java.lang.Object msg)
-
sender
public final ActorRef sender()
Description copied from interface:ActorContext
Returns the sender 'ActorRef' of the current message.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
sender
in interfaceActorContext
- Returns:
- (undocumented)
-
become
public void become(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> behavior, boolean discardOld)
Description copied from interface:ActorContext
Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. This method acts upon the behavior stack as follows:- if
discardOld = true
it will replace the top element (i.e. the current behavior) - ifdiscardOld = false
it will keep the current behavior and push the given one atopThe default of replacing the current behavior on the stack has been chosen to avoid memory leaks in case client code is written without consulting this documentation first (i.e. always pushing new behaviors and never issuing an
unbecome()
)*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
become
in interfaceActorContext
- Parameters:
behavior
- (undocumented)discardOld
- (undocumented)
-
become
public void become(Procedure<java.lang.Object> behavior)
Description copied from interface:UntypedActorContext
Changes the Actor's behavior to become the new 'Procedure' handler. Replaces the current behavior on the top of the behavior stack.- Specified by:
become
in interfaceUntypedActorContext
- Parameters:
behavior
- (undocumented)
-
become
public void become(Procedure<java.lang.Object> behavior, boolean discardOld)
Description copied from interface:UntypedActorContext
Changes the Actor's behavior to become the new 'Procedure' handler. This method acts upon the behavior stack as follows:- if
discardOld = true
it will replace the top element (i.e. the current behavior) - ifdiscardOld = false
it will keep the current behavior and push the given one atopThe default of replacing the current behavior on the stack has been chosen to avoid memory leaks in case client code is written without consulting this documentation first (i.e. always pushing new behaviors and never issuing an
unbecome()
)- Specified by:
become
in interfaceUntypedActorContext
- Parameters:
behavior
- (undocumented)discardOld
- (undocumented)
-
become$default$2
public boolean become$default$2()
-
unbecome
public void unbecome()
Description copied from interface:ActorContext
Reverts the Actor behavior to the previous one on the behavior stack.*Warning*: This method is not thread-safe and must not be accessed from threads other than the ordinary actor message processing thread, such as
CompletionStage
andFuture
callbacks.- Specified by:
unbecome
in interfaceActorContext
-
newActor
protected Actor newActor()
-
create
protected void create(scala.Option<ActorInitializationException> failure)
-
handleSupervise
protected void handleSupervise(ActorRef child, boolean async)
-
clearActorCellFields
protected final void clearActorCellFields(ActorCell cell)
-
clearActorFields
protected final void clearActorFields(Actor actorInstance, boolean recreate)
-
setActorFields
protected final void setActorFields(Actor actorInstance, ActorContext context, ActorRef self)
-
publish
protected final void publish(Logging.LogEvent e)
-
clazz
protected final java.lang.Class<?> clazz(java.lang.Object o)
-
-