/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@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) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void start(Deployable deployable, DeployableMonitor monitor) { start(deployable); // Wait for the Deployable to be started DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@inheritDoc} */ @Override public void redeploy(Deployable deployable, DeployableMonitor monitor) { this.redeploy(deployable); // Wait for the Deployable to be redeployed DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watchForAvailability(); }
/** * {@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(); }
/** * {@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); }
/** * {@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(); }
monitor.setLogger(getLogger()); DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger());
/** * Waits until all deployables with a deployable monitor are deployed / undeployed. * * @param container Container where is deployable deployed. * @param starting <code>true</code> if container is starting (i.e., wait for deployment), * <code>false</code> otherwise. */ protected void waitDeployableMonitor( org.codehaus.cargo.container.Container container, boolean starting) { if (getDeployablesElement() != null) { Logger watchdogLogger = createLogger(); for (Deployable deployable : getDeployablesElement()) { DeployableMonitorFactory monitorFactory = new DefaultDeployableMonitorFactory(); DeployableMonitor monitor = monitorFactory. createDeployableMonitor(container, deployable); if (monitor != null) { DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(watchdogLogger); monitor.setLogger(watchdogLogger); watchdog.watch(starting); } } } }
/** * Waits until all deployables with a deployable monitor are deployed / undeployed. * * @param starting <code>true</code> if container is starting (i.e., wait for deployment), * <code>false</code> otherwise. */ protected void waitDeployableMonitor(boolean starting) { if (getConfiguration() != null && getConfiguration().getDeployables() != null) { for (DeployableElement deployableElement : getConfiguration().getDeployables()) { DeployableMonitor deployableMonitor = deployableElement.createDeployableMonitor(); if (deployableMonitor != null) { DeployerWatchdog watchdog = new DeployerWatchdog(deployableMonitor); watchdog.setLogger(container.getLogger()); deployableMonitor.setLogger(container.getLogger()); watchdog.watch(starting); } } } } }
/** * Waits until all deployables with a deployable monitor are deployed / undeployed. * * @param starting <code>true</code> if container is starting (i.e., wait for deployment), * <code>false</code> otherwise. */ protected void waitDeployableMonitor(boolean starting) { if (getConfiguration() != null && getConfiguration().getDeployables() != null) { for (DeployableElement deployableElement : getConfiguration().getDeployables()) { DeployableMonitor deployableMonitor = deployableElement.createDeployableMonitor(); if (deployableMonitor != null) { DeployerWatchdog watchdog = new DeployerWatchdog(deployableMonitor); watchdog.setLogger(container.getLogger()); deployableMonitor.setLogger(container.getLogger()); watchdog.watch(starting); } } } } }