Class Supervisor.ChildSpec
- java.lang.Object
-
- co.paralleluniverse.actors.behaviors.Supervisor.ChildSpec
-
- Enclosing class:
- Supervisor
public static class Supervisor.ChildSpec extends java.lang.Object
Describes a child actor's configuration in a supervisor
-
-
Constructor Summary
Constructors Constructor Description ChildSpec(java.lang.String id, Supervisor.ChildMode mode, int maxRestarts, long duration, java.util.concurrent.TimeUnit unit, long shutdownDeadline, ActorBuilder<?,?> builder)
A new spec.ChildSpec(java.lang.String id, Supervisor.ChildMode mode, int maxRestarts, long duration, java.util.concurrent.TimeUnit unit, long shutdownDeadline, ActorRef<?> actor)
A new spec.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActorBuilder<?,?>
getBuilder()
The child'sbuilder
long
getDuration()
The duration in which the number of restarts is counted towards themax restarts
.java.util.concurrent.TimeUnit
getDurationUnit()
java.lang.String
getId()
The child's (optional) identifier (name)int
getMaxRestarts()
The maximum number of times the child actor is allowed to restart within a givenduration
before the supervisor gives up and kills itself.Supervisor.ChildMode
getMode()
The child'smode
.long
getShutdownDeadline()
The time in milliseconds the supervisor should wait for the child actor to terminate from the time it was requested to shutdown; after the deadline expires, the child actor is terminated forcefully.java.lang.String
toString()
-
-
-
Constructor Detail
-
ChildSpec
public ChildSpec(java.lang.String id, Supervisor.ChildMode mode, int maxRestarts, long duration, java.util.concurrent.TimeUnit unit, long shutdownDeadline, ActorBuilder<?,?> builder)
A new spec.- Parameters:
id
- the child's (optional) identifier (name)mode
- the child'smode
.maxRestarts
- the maximum number of times the child actor is allowed to restart within the givenduration
before the supervisor gives up and kills itself.duration
- the duration in which the number of restarts is counted towardsmaxRestarts
.unit
- thetime unit
of theduration
formaxRestarts
.shutdownDeadline
- the time in milliseconds the supervisor should wait for the child actor to terminate from the time it was requested to shutdown; after the deadline expires, the child actor is terminated forcefully.builder
- the child'sbuilder
-
ChildSpec
public ChildSpec(java.lang.String id, Supervisor.ChildMode mode, int maxRestarts, long duration, java.util.concurrent.TimeUnit unit, long shutdownDeadline, ActorRef<?> actor)
A new spec. This constructor takes anActorRef
to the actor rather than anActorBuilder
. If theActorRef
also implementsActorBuilder
it will be used to restart the actor.ActorRef
s to local actors implementActorBuilder
usingActor
'sreinstantiate
method.- Parameters:
id
- the child's (optional) identifier (name)mode
- the child'smode
.maxRestarts
- the maximum number of times the child actor is allowed to restart within the givenduration
before the supervisor gives up and kills itself.duration
- the duration in which the number of restarts is counted towardsmaxRestarts
.unit
- thetime unit
of theduration
formaxRestarts
.shutdownDeadline
- the time in milliseconds the supervisor should wait for the child actor to terminate from the time it was requested to shutdown; after the deadline expires, the child actor is terminated forcefully.actor
- the child actor
-
-
Method Detail
-
getId
public java.lang.String getId()
The child's (optional) identifier (name)
-
getBuilder
public ActorBuilder<?,?> getBuilder()
The child'sbuilder
-
getMode
public Supervisor.ChildMode getMode()
The child'smode
.
-
getMaxRestarts
public int getMaxRestarts()
The maximum number of times the child actor is allowed to restart within a givenduration
before the supervisor gives up and kills itself.
-
getDuration
public long getDuration()
The duration in which the number of restarts is counted towards themax restarts
.
-
getDurationUnit
public java.util.concurrent.TimeUnit getDurationUnit()
-
getShutdownDeadline
public long getShutdownDeadline()
The time in milliseconds the supervisor should wait for the child actor to terminate from the time it was requested to shutdown; after the deadline expires, the child actor is terminated forcefully.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-