/** * 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); }
/** * 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); }
watchdog.setLogger(getLogger()); watchdog.watch(waitForStarting);
/** * 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); } } } } }