@Override public InitialDeploymentSetBuilder withGracefulShutdown(long timeout, TimeUnit timeUnit) { DeploymentSetPlanImpl currentSet = getCurrentDeploymentSetPlan(); long period = timeUnit.toMillis(timeout); if (currentSet.isShutdown() && period != currentSet.getGracefulShutdownTimeout()) { throw MESSAGES.gracefulShutdownAlreadyConfigured(currentSet.getGracefulShutdownTimeout()); } DeploymentSetPlanImpl newSet = currentSet.setGracefulTimeout(period); return new InitialDeploymentSetBuilderImpl(this, newSet); }
@Override public DeploymentPlanBuilder withGracefulShutdown(long timeout, TimeUnit timeUnit) { // TODO determine how to remove content. Perhaps with a signal to the // deployment repository service such that as part of shutdown after // undeploys are done it then removes the content? if (deploymentActions.size() > 0) { // Someone has to cast this impl class cleanup(); throw MESSAGES.operationsNotAllowed(InitialDeploymentPlanBuilder.class.getSimpleName()); } if (globalRollback) { cleanup(); throw MESSAGES.globalRollbackNotCompatible(); } long period = timeUnit.toMillis(timeout); if (shutdown && period != gracefulShutdownPeriod) { cleanup(); throw MESSAGES.gracefulShutdownAlreadyConfigured(gracefulShutdownPeriod); } return new DeploymentPlanBuilderImpl(this, period); }
@Override public DeploymentPlanBuilder withShutdown() { // TODO determine how to remove content. Perhaps with a signal to the // deployment repository service such that as part of shutdown after // undeploys are done it then removes the content? if (deploymentActions.size() > 0) { // Someone has to cast this impl class cleanup(); throw MESSAGES.operationsNotAllowed(InitialDeploymentPlanBuilder.class.getSimpleName()); } if (globalRollback) { cleanup(); throw MESSAGES.globalRollbackNotCompatible(); } if (shutdown && gracefulShutdownPeriod != -1) { cleanup(); throw MESSAGES.gracefulShutdownAlreadyConfigured(gracefulShutdownPeriod); } return new DeploymentPlanBuilderImpl(this, -1); }