Class Supervisor.ChildSpec
- java.lang.Object
-
- co.paralleluniverse.actors.behaviors.Supervisor.ChildSpec
-
- Enclosing class:
- Supervisor
public static class Supervisor.ChildSpec extends java.lang.ObjectDescribes 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'sbuilderlonggetDuration()The duration in which the number of restarts is counted towards themax restarts.java.util.concurrent.TimeUnitgetDurationUnit()java.lang.StringgetId()The child's (optional) identifier (name)intgetMaxRestarts()The maximum number of times the child actor is allowed to restart within a givendurationbefore the supervisor gives up and kills itself.Supervisor.ChildModegetMode()The child'smode.longgetShutdownDeadline()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.StringtoString()
-
-
-
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 givendurationbefore the supervisor gives up and kills itself.duration- the duration in which the number of restarts is counted towardsmaxRestarts.unit- thetime unitof thedurationformaxRestarts.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 anActorRefto the actor rather than anActorBuilder. If theActorRefalso implementsActorBuilderit will be used to restart the actor.ActorRefs to local actors implementActorBuilderusingActor'sreinstantiatemethod.- 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 givendurationbefore the supervisor gives up and kills itself.duration- the duration in which the number of restarts is counted towardsmaxRestarts.unit- thetime unitof thedurationformaxRestarts.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 givendurationbefore 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:
toStringin classjava.lang.Object
-
-