Package akka.actor
Class FunctionRef
- java.lang.Object
-
- akka.actor.ActorRef
-
- akka.actor.InternalActorRef
-
- akka.actor.FunctionRef
-
- All Implemented Interfaces:
ActorRefScope
,LocalRef
,MinimalActorRef
,ScalaActorRef
,java.io.Serializable
,java.lang.Comparable<ActorRef>
,scala.Serializable
public final class FunctionRef extends InternalActorRef implements MinimalActorRef
Have this FunctionRef watch the given Actor.Upon receiving the Terminated message,
unwatch
must be called to avoid resource leak, which is different from an ordinary actor.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FunctionRef(ActorPath path, ActorRefProvider provider, ActorSystem system, scala.Function2<ActorRef,java.lang.Object,scala.runtime.BoxedUnit> f)
-
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)
boolean
isTerminated()
INTERNAL API: Returns “true” if the actor is locally known to be terminated, “false” if alive or uncertain.boolean
isWatching(ActorRef actorRef)
Query whether this FunctionRef is currently watching the given Actor.ActorPath
path()
ActorRefProvider
provider()
Get a reference to the actor ref provider which created this ref.void
sendSystemMessage(SystemMessage message)
protected void
sendTerminated()
void
stop()
void
unwatch(ActorRef actorRef)
Have this FunctionRef unwatch the given Actor.void
watch(ActorRef actorRef)
Have this FunctionRef watch the given Actor.-
Methods inherited from class akka.actor.InternalActorRef
getChild, getParent, isLocal, restart, resume, start, suspend
-
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.MinimalActorRef
getChild, getParent, restart, resume, start, suspend, writeReplace
-
-
-
-
Constructor Detail
-
FunctionRef
public FunctionRef(ActorPath path, ActorRefProvider provider, ActorSystem system, scala.Function2<ActorRef,java.lang.Object,scala.runtime.BoxedUnit> f)
-
-
Method Detail
-
$bang
public void $bang(java.lang.Object message, ActorRef sender)
- Specified by:
$bang
in interfaceMinimalActorRef
- Specified by:
$bang
in interfaceScalaActorRef
-
$bang$default$2
public ActorRef $bang$default$2(java.lang.Object message)
- Specified by:
$bang$default$2
in interfaceMinimalActorRef
- Specified by:
$bang$default$2
in interfaceScalaActorRef
-
isTerminated
public boolean isTerminated()
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 interfaceMinimalActorRef
- Specified by:
isTerminated
in classInternalActorRef
- Returns:
- (undocumented)
-
isWatching
public boolean isWatching(ActorRef actorRef)
Query whether this FunctionRef is currently watching the given Actor.- Parameters:
actorRef
- (undocumented)- 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 classInternalActorRef
- Returns:
- (undocumented)
-
sendSystemMessage
public void sendSystemMessage(SystemMessage message)
- Specified by:
sendSystemMessage
in interfaceMinimalActorRef
- Specified by:
sendSystemMessage
in classInternalActorRef
-
sendTerminated
protected void sendTerminated()
-
stop
public void stop()
- Specified by:
stop
in interfaceMinimalActorRef
- Specified by:
stop
in classInternalActorRef
-
unwatch
public void unwatch(ActorRef actorRef)
Have this FunctionRef unwatch the given Actor.Upon receiving the Terminated message,
unwatch
must be called to avoid resource leak, which is different from an ordinary actor.- Parameters:
actorRef
- (undocumented)
-
watch
public void watch(ActorRef actorRef)
Have this FunctionRef watch the given Actor.Upon receiving the Terminated message,
unwatch
must be called to avoid resource leak, which is different from an ordinary actor.- Parameters:
actorRef
- (undocumented)
-
-