public class ActorContextAdapter<T> extends java.lang.Object implements ActorContext<T>
ActorContext
as an ActorContext
.Constructor and Description |
---|
ActorContextAdapter(ActorContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
cancelReceiveTimeout()
Cancel the sending of receive timeout notifications.
|
scala.Option<ActorRef<java.lang.Object>> |
child(java.lang.String name)
The named child Actor if it is alive.
|
scala.collection.Iterable<ActorRef<scala.runtime.Nothing$>> |
children()
The list of child Actors created by this Actor during its lifetime that
are still alive, in no particular order.
|
scala.concurrent.ExecutionContextExecutor |
executionContext()
This Actor’s execution context.
|
int |
mailboxCapacity()
Return the mailbox capacity that was configured by the parent for this actor.
|
T |
receiveTimeoutMsg() |
<U> Cancellable |
schedule(scala.concurrent.duration.FiniteDuration delay,
ActorRef<U> target,
U msg)
Schedule the sending of the given message to the given target Actor after
the given time period has elapsed.
|
ActorRef<T> |
self()
The identity of this Actor, bound to the lifecycle of this Actor instance.
|
void |
setReceiveTimeout(scala.concurrent.duration.FiniteDuration d,
T msg)
Schedule the sending of a notification in case no other
message is received during the given period of time.
|
<U> ActorRef<U> |
spawn(Behavior<U> behavior,
java.lang.String name,
DeploymentConfig deployment)
Create a child Actor from the given
Props and with the given name. |
<U> ActorRef<U> |
spawnAdapter(scala.Function1<U,T> f)
Create a child actor that will wrap messages such that other Actor’s
protocols can be ingested by this Actor.
|
<U> ActorRef<U> |
spawnAnonymous(Behavior<U> behavior,
DeploymentConfig deployment)
Create a child Actor from the given
Props under a randomly chosen name. |
boolean |
stop(ActorRef<scala.runtime.Nothing$> child)
Force the child Actor under the given name to terminate after it finishes
processing its current message.
|
ActorSystem<scala.runtime.Nothing$> |
system()
The
ActorSystem to which this Actor belongs. |
<U> ActorRef<U> |
unwatch(ActorRef<U> other)
Revoke the registration established by
watch . |
<U> ActorRef<U> |
watch(ActorRef<U> other)
Register for
Terminated notification once the Actor identified by the
given ActorRef terminates. |
public ActorContextAdapter(ActorContext ctx)
public ActorRef<T> self()
ActorContext
ActorRef
.self
in interface ActorContext<T>
public ActorSystem<scala.runtime.Nothing$> system()
ActorContext
ActorSystem
to which this Actor belongs.system
in interface ActorContext<T>
public int mailboxCapacity()
ActorContext
mailboxCapacity
in interface ActorContext<T>
public scala.collection.Iterable<ActorRef<scala.runtime.Nothing$>> children()
ActorContext
children
in interface ActorContext<T>
public scala.Option<ActorRef<java.lang.Object>> child(java.lang.String name)
ActorContext
child
in interface ActorContext<T>
name
- (undocumented)public <U> ActorRef<U> spawnAnonymous(Behavior<U> behavior, DeploymentConfig deployment)
ActorContext
Props
under a randomly chosen name.
It is good practice to name Actors wherever practical.spawnAnonymous
in interface ActorContext<T>
behavior
- (undocumented)deployment
- (undocumented)public <U> ActorRef<U> spawn(Behavior<U> behavior, java.lang.String name, DeploymentConfig deployment)
ActorContext
Props
and with the given name.spawn
in interface ActorContext<T>
behavior
- (undocumented)name
- (undocumented)deployment
- (undocumented)public boolean stop(ActorRef<scala.runtime.Nothing$> child)
ActorContext
stop
in interface ActorContext<T>
child
- (undocumented)ActorRef
points to a current child Actorpublic <U> ActorRef<U> watch(ActorRef<U> other)
ActorContext
Terminated
notification once the Actor identified by the
given ActorRef
terminates. This notification is also generated when the
ActorSystem
to which the referenced Actor belongs is declared as
failed (e.g. in reaction to being unreachable).watch
in interface ActorContext<T>
other
- (undocumented)public <U> ActorRef<U> unwatch(ActorRef<U> other)
ActorContext
watch
. A Terminated
notification will not subsequently be received for the referenced Actor.unwatch
in interface ActorContext<T>
other
- (undocumented)public T receiveTimeoutMsg()
public void setReceiveTimeout(scala.concurrent.duration.FiniteDuration d, T msg)
ActorContext
Duration.Undefined
to switch off this
mechanism.setReceiveTimeout
in interface ActorContext<T>
d
- (undocumented)msg
- (undocumented)public void cancelReceiveTimeout()
ActorContext
cancelReceiveTimeout
in interface ActorContext<T>
public scala.concurrent.ExecutionContextExecutor executionContext()
ActorContext
Future
combinators.executionContext
in interface ActorContext<T>
public <U> Cancellable schedule(scala.concurrent.duration.FiniteDuration delay, ActorRef<U> target, U msg)
ActorContext
Cancellable
cancel
on the returned
handle.schedule
in interface ActorContext<T>
delay
- (undocumented)target
- (undocumented)msg
- (undocumented)public <U> ActorRef<U> spawnAdapter(scala.Function1<U,T> f)
ActorContext
spawnAdapter
in interface ActorContext<T>
f
- (undocumented)