Github user neykov commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/520#discussion_r97789383 --- Diff: software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java --- @@ -944,14 +1002,19 @@ protected static boolean canStop(StopMode stopMode, boolean isStopped) { stopMode == StopMode.IF_NOT_STOPPED && !isStopped; } + /** @deprecated since 0.11.0. Use {@link #preStopConfirmCustom(AtomicReference)} instead. */ + @Deprecated + protected void preStopConfirmCustom() { + preStopConfirmCustom(RELEASEABLE_LATCH_TL.get()); + } + /** * Override to check whether stop can be executed. * Throw if stop should be aborted. */ - protected void preStopConfirmCustom() { + protected void preStopConfirmCustom(AtomicReference<ReleaseableLatch> stopLatchRef) { // Opportunity to block stop() until other dependent components are ready for it - Object val = entity().getConfig(SoftwareProcess.STOP_LATCH); - if (val != null) log.debug("{} finished waiting for stop-latch {}; continuing...", entity(), val); + stopLatchRef.set(waitForLatch(entity(), SoftwareProcess.STOP_LATCH)); --- End diff -- Good cleanup, will update.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---