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 Actoractor()protected voidactor_$eq(Actor a)voidautoReceiveMessage(Envelope msg)voidbecome(Procedure<java.lang.Object> behavior)Changes the Actor's behavior to become the new 'Procedure' handler.voidbecome(Procedure<java.lang.Object> behavior, boolean discardOld)Changes the Actor's behavior to become the new 'Procedure' handler.voidbecome(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.booleanbecome$default$2()ActorContextclassicActorContext()protected java.lang.Class<?>clazz(java.lang.Object o)protected voidclearActorCellFields(ActorCell cell)protected voidclearActorFields(Actor actorInstance, boolean recreate)static java.lang.ThreadLocal<scala.collection.immutable.List<ActorContext>>contextStack()protected voidcreate(scala.Option<ActorInitializationException> failure)EnvelopecurrentMessage()voidcurrentMessage_$eq(Envelope x$1)static intDefaultState()MessageDispatcherdispatcher()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 CancellableemptyCancellable()scala.concurrent.ExecutionContextExecutorgetDispatcher()Returns the dispatcher (MessageDispatcher) that is used for this Actor.InternalActorRefgetParent()Returns the supervisor of this actor.PropsgetProps()Retrieve the Props which were used to create this actor.ActorRefgetSelf()The ActorRef representing this actorActorSystemImplgetSystem()Returns the system this actor is running in.protected InternalActorRefguardian()Father of all children created by this interface.protected voidhandleSupervise(ActorRef child, boolean async)voidinvoke(Envelope messageHandle)booleanisLocal()Returns true if the actor is local, i.e.protected InternalActorReflookupRoot()INTERNAL APIprotected ActornewActor()static intnewUid()InternalActorRefparent()Returns the supervising parent ActorRef.Propsprops()Retrieve the Props which were used to create this actor.ActorRefProviderprovider()INTERNAL APIprotected voidpublish(Logging.LogEvent e)voidreceiveMessage(java.lang.Object msg)InternalActorRefself()The ActorRef representing this actorActorRefsender()Returns the sender 'ActorRef' of the current message.protected voidsetActorFields(Actor actorInstance, ActorContext context, ActorRef self)static scala.Tuple2<java.lang.String,java.lang.Object>splitNameAndUid(java.lang.String name)protected voidstash(SystemMessage msg)static intSuspendedState()static intSuspendedWaitForChildrenState()ActorSystemImplsystem()The system that the actor belongs to.ActorSystemImplsystemImpl()INTERNAL APIvoidsystemInvoke(SystemMessage message)static PropsterminatedProps()protected intuid()voidunbecome()Reverts the Actor behavior to the previous one on the behavior stack.static intundefinedUid()-
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:ActorContextThe 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
CompletionStageandFuturecallbacks.- Specified by:
systemin interfaceActorContext- Specified by:
systemin interfaceCell- Returns:
- (undocumented)
-
self
public InternalActorRef self()
Description copied from interface:ActorContextThe ActorRef representing this actorThis method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStageandFuturecallbacks.- Specified by:
selfin interfaceActorContext- Specified by:
selfin interfaceCell- Returns:
- (undocumented)
-
props
public final Props props()
Description copied from interface:ActorContextRetrieve 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
CompletionStageandFuturecallbacks.- Specified by:
propsin interfaceActorContext- Specified by:
propsin interfaceCell- Returns:
- (undocumented)
-
dispatcher
public MessageDispatcher dispatcher()
Description copied from interface:ActorContextReturns 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
CompletionStageandFuturecallbacks.- Specified by:
dispatcherin interfaceActorContext- Specified by:
dispatcherin interfaceActorRefFactory- Returns:
- (undocumented)
-
parent
public InternalActorRef parent()
Description copied from interface:ActorContextReturns 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
CompletionStageandFuturecallbacks.- Specified by:
parentin interfaceActorContext- Specified by:
parentin interfaceCell- Returns:
- (undocumented)
-
isLocal
public final boolean isLocal()
Description copied from interface:CellReturns 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:ActorRefFactoryINTERNAL API- Specified by:
systemImplin interfaceActorRefFactory- Specified by:
systemImplin interfaceCell- Returns:
- (undocumented)
-
guardian
protected final InternalActorRef guardian()
Description copied from interface:ActorRefFactoryFather of all children created by this interface.INTERNAL API
- Specified by:
guardianin interfaceActorRefFactory- Returns:
- (undocumented)
-
lookupRoot
protected final InternalActorRef lookupRoot()
Description copied from interface:ActorRefFactoryINTERNAL API- Specified by:
lookupRootin interfaceActorRefFactory- Returns:
- (undocumented)
-
provider
public final ActorRefProvider provider()
Description copied from interface:ActorRefFactoryINTERNAL API- Specified by:
providerin interfaceActorRefFactory- Returns:
- (undocumented)
-
classicActorContext
public final ActorContext classicActorContext()
- Specified by:
classicActorContextin 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.ActorContextReturns 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
CompletionStagecallbacks.- Specified by:
getParentin interfaceAbstractActor.ActorContext- Returns:
- (undocumented)
-
getSystem
public final ActorSystemImpl getSystem()
Description copied from interface:AbstractActor.ActorContextReturns 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
CompletionStagecallbacks.- Specified by:
getSystemin interfaceAbstractActor.ActorContext- Returns:
- (undocumented)
-
getDispatcher
public final scala.concurrent.ExecutionContextExecutor getDispatcher()
Description copied from interface:AbstractActor.ActorContextReturns 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
CompletionStageandFuturecallbacks.- Specified by:
getDispatcherin interfaceAbstractActor.ActorContext- Returns:
- (undocumented)
-
getSelf
public final ActorRef getSelf()
Description copied from interface:AbstractActor.ActorContextThe ActorRef representing this actorThis method is thread-safe and can be called from other threads than the ordinary actor message processing thread, such as
CompletionStageandFuturecallbacks.- Specified by:
getSelfin interfaceAbstractActor.ActorContext- Returns:
- (undocumented)
-
getProps
public final Props getProps()
Description copied from interface:AbstractActor.ActorContextRetrieve 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
CompletionStageandFuturecallbacks.- Specified by:
getPropsin 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:ActorContextReturns 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
CompletionStageandFuturecallbacks.- Specified by:
senderin interfaceActorContext- Returns:
- (undocumented)
-
become
public void become(scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> behavior, boolean discardOld)Description copied from interface:ActorContextChanges the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler. This method acts upon the behavior stack as follows:- if
discardOld = trueit will replace the top element (i.e. the current behavior) - ifdiscardOld = falseit 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
CompletionStageandFuturecallbacks.- Specified by:
becomein interfaceActorContext- Parameters:
behavior- (undocumented)discardOld- (undocumented)
-
become
public void become(Procedure<java.lang.Object> behavior)
Description copied from interface:UntypedActorContextChanges the Actor's behavior to become the new 'Procedure' handler. Replaces the current behavior on the top of the behavior stack.- Specified by:
becomein interfaceUntypedActorContext- Parameters:
behavior- (undocumented)
-
become
public void become(Procedure<java.lang.Object> behavior, boolean discardOld)
Description copied from interface:UntypedActorContextChanges the Actor's behavior to become the new 'Procedure' handler. This method acts upon the behavior stack as follows:- if
discardOld = trueit will replace the top element (i.e. the current behavior) - ifdiscardOld = falseit 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:
becomein interfaceUntypedActorContext- Parameters:
behavior- (undocumented)discardOld- (undocumented)
-
become$default$2
public boolean become$default$2()
-
unbecome
public void unbecome()
Description copied from interface:ActorContextReverts 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
CompletionStageandFuturecallbacks.- Specified by:
unbecomein 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)
-
-