/** * Shut down actor system force. */ public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else { logger.info("Actor system has been terminated already. NO OP."); } }
@Override public Void call() throws Exception { actorSystem.awaitTermination(); return null; } }, getExecutor());
@Override public void run() { try { actorSystem.awaitTermination(terminationTimeout); } catch (Exception e) { if (e instanceof TimeoutException) { log.error("Actor system shut down timed out.", e); } else { log.error("Failure during actor system shut down.", e); } } finally { log.info("Shutdown completed. Stopping JVM."); System.exit(0); } } }
@Override public void run() { try { actorSystem.awaitTermination(terminationTimeout); } catch (Exception e) { if (e instanceof TimeoutException) { log.error("Actor system shut down timed out.", e); } else { log.error("Failure during actor system shut down.", e); } } finally { log.info("Shutdown completed. Stopping JVM."); System.exit(0); } } }
private void shutdownActorSystem(ActorSystem actorSystem) { // shut the actor system down actorSystem.shutdown(); try { // give it some time to complete the shutdown actorSystem.awaitTermination(timeout); } finally { // now let's crash the JVM System.exit(exitCode); } } }
private void shutdownActorSystem(ActorSystem actorSystem) { // shut the actor system down actorSystem.shutdown(); try { // give it some time to complete the shutdown actorSystem.awaitTermination(timeout); } finally { // now let's crash the JVM System.exit(exitCode); } } }
@Override public boolean stop() { if (applicationSystemEnabled) { logger.info("Shutdown application default Akka system."); applicationSystem.shutdown(); applicationSystem.awaitTermination(); } return true; } }
private static void closeActorSystem(FiniteDuration timeout) { synchronized (actorSystemLock) { actorSystemUsers--; if (actorSystemUsers == 0 && actorSystem != null) { actorSystem.shutdown(); actorSystem.awaitTermination(timeout); actorSystem = null; } } }
private static void closeActorSystem(FiniteDuration timeout) { synchronized (actorSystemLock) { actorSystemUsers--; if (actorSystemUsers == 0 && actorSystem != null) { actorSystem.shutdown(); actorSystem.awaitTermination(timeout); actorSystem = null; } } }
@Override public void stopService() { LOG.info("Stopping Akka RPC service."); synchronized (lock) { if (stopped) { return; } stopped = true; actorSystem.shutdown(); actors.clear(); } actorSystem.awaitTermination(); }
@Override public void run(SourceFunction.SourceContext<Object> ctx) throws Exception { LOG.info("Starting the Receiver actor {}", actorName); receiverActor = receiverActorSystem.actorOf( Props.create(classForActor, ctx, urlOfPublisher, autoAck), actorName); LOG.info("Started the Receiver actor {} successfully", actorName); receiverActorSystem.awaitTermination(); }
/** * Shut down actor system force. */ public static void shutDownActorSystemForce() { if (!actorSystem.isTerminated()) { logger.info("shutting down actor system..."); actorSystem.shutdown(); actorSystem.awaitTermination(timeOutDuration); logger.info("Actor system has been shut down."); } else { logger.info("Actor system has been terminated already. NO OP."); } }
public void shutdown() { if (isLoaded()) { actorSystem.shutdown(); actorSystem.awaitTermination(); actorSystem = null; } }
public void shutdown() { if (isLoaded()) { actorSystem.shutdown(); actorSystem.awaitTermination(); actorSystem = null; } }
public void close() throws Exception { Exception exception = null; actorSystem.shutdown(); actorSystem.awaitTermination(); try { highAvailabilityServices.closeAndCleanupAllData(); } catch (Exception e) { exception = e; } scheduledExecutorService.shutdownNow(); try { scheduledExecutorService.awaitTermination(timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); exception = ExceptionUtils.firstOrSuppressed(e, exception); } if (exception != null) { throw exception; } } }
@After public void afterTest() throws Exception { feederActorSystem.shutdown(); feederActorSystem.awaitTermination(); source.cancel(); sourceThread.join(); }
@Override public void downloadAndIndex(final String path, final IndexWriter writer) { ActorSystem actorSystem = ActorSystem.create(); ActorRef master = actorSystem.actorOf(Props.create(SimpleActorMaster.class, new HtmlParserPageRetriever(path), writer)); master.tell(path, actorSystem.guardian()); actorSystem.awaitTermination(); }
@Override public void downloadAndIndex(String path, IndexWriter writer) { ActorSystem actorSystem = ActorSystem.create(); ActorRef master = actorSystem.actorOf(Props.create(SupervisingActor.class, new IndexerImpl(writer), new ChaosMonkeyPageRetriever(path))); master.tell(path, actorSystem.guardian()); actorSystem.awaitTermination(); }
@Override public void downloadAndIndex(String path, IndexWriter writer) { ActorSystem actorSystem = ActorSystem.create(); ActorRef master = actorSystem.actorOf(Props.create(ParallelMaster.class, new IndexerImpl(writer), new ChaosMonkeyPageRetriever(path))); master.tell(path, actorSystem.guardian()); actorSystem.awaitTermination(); }
@Override public void downloadAndIndex(final String path, final IndexWriter writer) { ActorSystem actorSystem = ActorSystem.create(); ActorRef master = actorSystem.actorOf(Props.create(ParallelMaster.class, new IndexerImpl(writer), new HtmlParserPageRetriever(path))); master.tell(path, actorSystem.guardian()); actorSystem.awaitTermination(); }