/** * {@inheritDoc} */ @Override public void undeploy(Deployable deployable, DeployableMonitor monitor) { try { undeploy(deployable); } catch (Throwable t) { // CARGO-1100: When the undeployment action has failed, log the failure and then wait // for the watchdog to return. If undeployment was indeed complete, the watchdog will // detect it; else it will make the method fail. getLogger().info("The undeployment has failed: " + t.toString(), this.getClass().getName()); if (getLogger().getLevel() == LogLevel.DEBUG) { Writer stackTrace = new StringWriter(); t.printStackTrace(new PrintWriter(stackTrace)); getLogger().debug(stackTrace.toString(), this.getClass().getName()); } } // Wait for the Deployable to be undeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForUnavailability(); }
/** * {@inheritDoc} */ @Override public void stop(Deployable deployable, DeployableMonitor monitor) { stop(deployable); // Wait for the Deployable to be stopped DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForUnavailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { try { undeploy(deployable); } catch (Throwable t) { getLogger().info("The undeployment phase of the redeploy action has failed: " + t.toString(), this.getClass().getName()); if (getLogger().getLevel() == LogLevel.DEBUG) { Writer stackTrace = new StringWriter(); t.printStackTrace(new PrintWriter(stackTrace)); getLogger().debug(stackTrace.toString(), this.getClass().getName()); } } // Wait for the Deployable to be undeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForUnavailability(); deploy(deployable, monitor); }