private void sendCommandResponsesAndStop() { devOpsCommandSender.tell(AggregatedDevOpsCommandResponse.of(commandResponses, DevOpsCommandResponse.TYPE_PREFIX + devOpsCommand.getName(), commandResponses.isEmpty() ? HttpStatusCode.REQUEST_TIMEOUT : HttpStatusCode.OK, devOpsCommand.getDittoHeaders()), getSelf()); getContext().stop(getSelf()); }
private void sendCommandResponsesAndStop() { devOpsCommandSender.tell(AggregatedDevOpsCommandResponse.of(commandResponses, DevOpsCommandResponse.TYPE_PREFIX + devOpsCommand.getName(), commandResponses.isEmpty() ? HttpStatusCode.REQUEST_TIMEOUT : HttpStatusCode.OK, devOpsCommand.getDittoHeaders()), getSelf()); getContext().stop(getSelf()); }
private void handleJobStop(Object msg) { Messages.JobStop message = (Messages.JobStop) msg; markMessageProcessingAsStarted(message); getSelf().tell(Messages.newJobStateUpdated(plugin, JOB_STATE.STOPPING), getSelf()); stopping = true; getContext().getChildren().forEach(e -> getContext().stop(e)); markMessageProcessingAsEnded(message); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
private void stop() { logger.clearMDC(); // destroy ourself: getContext().stop(getSelf()); }
/** * Stops a child actor. * * @param actor the ActorRef */ protected final void stopChildActor(final ActorRef actor) { if (actor != null) { log.debug("Stopping child actor <{}>.", actor.path()); getContext().stop(actor); } }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
private void stopMessageMappingProcessorActor() { if (messageMappingProcessorActor != null) { log.debug("Stopping MessageMappingProcessorActor."); getContext().stop(messageMappingProcessorActor); messageMappingProcessorActor = null; } }
private void streamCompleted(final Object completionMessage) { log.info("Stream successfully finished."); getCompletionRecipient().tell(completionMessage, getSelf()); getContext().stop(getSelf()); }
private void streamCompleted(final Object completionMessage) { log.info("Stream successfully finished."); getCompletionRecipient().tell(completionMessage, getSelf()); getContext().stop(getSelf()); }
private void stopChildActor(final ActorRef actor) { log.debug("Stopping child actor <{}>.", actor.path()); getContext().stop(actor); }
/** * Stops a child actor. * * @param actor the ActorRef */ protected final void stopChildActor(final ActorRef actor) { if (actor != null) { log.debug("Stopping child actor <{}>.", actor.path()); getContext().stop(actor); } }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
@Override public Receive createReceive() { return receiveBuilder() .matchEquals(Msg.DONE, m -> { // when the greeter is done, stop this actor and with it the application getContext().stop(self()); }) .build(); }
private void scheduleShutdown() { shutdown = getContext().system() .scheduler() .scheduleOnce(Duration.create(SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS), () -> { if (null != getContext()) { getContext().stop(getSelf()); } }, getContext().system().dispatcher()); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(CountThings.class, cmd -> catchDittoRuntimeException(this::handleCountThings, cmd)) .match(QueryThings.class, cmd -> catchDittoRuntimeException(this::handleQueryThings, cmd)) .match(SudoCountThings.class, cmd -> catchDittoRuntimeException(this::handleSudoCountThings, cmd)) .matchAny(any -> { logger.warning("Got unknown message '{}'", any); getContext().stop(getSelf()); }).build(); }
private void stopMessageMappingProcessorActor() { if (messageMappingProcessorActor != null) { log.debug("Stopping MessageMappingProcessorActor."); getContext().stop(messageMappingProcessorActor); messageMappingProcessorActor = null; } }