akka-actor/src/test/java/akka/config/SupervisionConfig.java
/*Just some sample code to demonstrate the declarative supervision configuration for Java */
Just some sample code to demonstrate the declarative supervision configuration for Java
Just some sample code to demonstrate the declarative supervision configuration for Java
public SupervisorConfig createSupervisorConfig(List<ActorRef> toSupervise) {
  ArrayList<Server> targets = new ArrayList<Server>(toSupervise.size());
   for(ActorRef ref : toSupervise) {
     targets.add(new Supervise(ref, permanent(), new RemoteAddress("localhost",9999)));
   }
   return new SupervisorConfig(new AllForOneStrategy(new Class[] { Exception.class },50,1000), targets.toArray(new Server[0]));
 }
public SupervisorConfig createSupervisorConfig ( List < ActorRef > toSupervise ) { ArrayList < Server > targets = new ArrayList < Server > ( toSupervise . size ( ) ) ; for ( ActorRef ref : toSupervise ) { targets . add ( new Supervise ( ref , permanent ( ) , new RemoteAddress ( "localhost" , 9999 ) ) ) ; } return new SupervisorConfig ( new AllForOneStrategy ( new Class [ ] { Exception . class } , 50 , 1000 ) , targets . toArray ( new Server [ 0 ] ) ) ; }
Just some sample code to demonstrate the declarative supervision configuration for Java
Just some sample code to demonstrate the declarative supervision configuration for Java