/** * {@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(); }
/** * Wait till the monitored Deployable is made available or throw an exception if the timeout * period is reached. Equivalent to <code>watch(true)</code>. */ public void watchForAvailability() { watch(true); }
/** * {@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(); }
/** * 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); } } } }
+ " within the timeout period [" + this.monitor.getTimeout() + "]. The Deployable state is thus unknown."; getLogger().info(message, this.getClass().getName()); throw new ContainerException(message);
/** * 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); } } } } }
/** * {@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 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(); }
"Cargo Ping Component used to verify if the container is started."); monitor.setLogger(getLogger()); DeployerWatchdog watchdog = new DeployerWatchdog(monitor); watchdog.setLogger(getLogger()); watchdog.watch(waitForStarting);
/** * {@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(); }
/** * Wait till the monitored Deployable is made unavailable or throw an exception if the timeout * period is reached. Equivalent to <code>watch(false)</code>. */ public void watchForUnavailability() { watch(false); }
/** * {@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(); }
/** * 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); } } } } }
/** * {@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 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(); }