/** * Helper method to redeploy multiple deployables at a time. * @see Deployer#redeploy(Deployable) * @param deployables Deployables to redeploy. */ public void redeploy(List<Deployable> deployables) { for (Deployable deployable : deployables) { redeploy(deployable); } }
/** * @param container the container into which to perform deployment operations */ public AbstractDeployer(Container container) { setLogger(container.getLogger()); }
/** * {@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 deploy(Deployable deployable, DeployableMonitor monitor) { try { deploy(deployable); } catch (Throwable t) { // CARGO-1100: When the deployment action has failed, log the failure and then wait for // the watchdog to return. If deployment was indeed complete, the watchdog will detect // it; else it will make the method fail. getLogger().info("The deployment 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 deployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * Helper method to deploy multiple deployables at a time. * @see Deployer#deploy(Deployable) * @param deployables Deployables to deploy. */ public void deploy(List<Deployable> deployables) { for (Deployable deployable : deployables) { deploy(deployable); } }
/** * {@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); }
deployer.redeploy(getDeployables());
deployer.redeploy(getDeployables());