/** * return whether or not the container is running. * * @return true, if the container is running */ private boolean isRunning() { return getContainer().getState().equals(State.STARTED) || getContainer().getState().equals(State.STARTING); }
/** * {@inheritDoc} deploys via hotDeployer, if the server is started or starting. Otherwise, it * uses the coldDeployer. * * @see org.codehaus.cargo.container.spi.deployer.AbstractDeployer#deploy(org.codehaus.cargo.container.deployable.Deployable) * @param deployable - what to deploy */ @Override public void deploy(Deployable deployable) { if (isRunning()) { getHotDeployer().deploy(deployable); } else { getColdDeployer().deploy(deployable); } }
/** * {@inheritDoc} undeploys via hotDeployer, if the server is started or starting. Otherwise, it * uses the coldDeployer. * * @see org.codehaus.cargo.container.spi.deployer.AbstractDeployer#undeploy(org.codehaus.cargo.container.deployable.Deployable) * @param deployable - what to undeploy */ @Override public void undeploy(Deployable deployable) { if (isRunning()) { getHotDeployer().undeploy(deployable); } else { getColdDeployer().undeploy(deployable); } }