@Override public void stop() throws CubeControlException { try { if (configuration.isNamespaceCleanupEnabled()) { client.destroy(resource); } else { logger.info("Ignoring cleanup for service " + resource.getMetadata().getName()); } this.state = State.STOPPED; } catch (Exception e) { this.state = State.STOP_FAILED; throw CubeControlException.failedStop(getId(), e); } }
@Override public void stop() throws CubeControlException { if (state == State.STOPPED || state == State.PRE_RUNNING || state == State.DESTROYED) { return; } try { lifecycle.fire(new BeforeStop(id)); long currentTime = System.currentTimeMillis(); try { if (configuration.isKillContainer()) { executor.killContainer(id); } else { executor.stopContainer(id); } } catch (NotFoundException e) { } catch (NotModifiedException e) { } this.stoppingTimeInMillis = System.currentTimeMillis() - currentTime; state = State.STOPPED; lifecycle.fire(new AfterStop(id)); } catch (Exception e) { state = State.STOP_FAILED; throw CubeControlException.failedStop(id, e); } }
@Override public void stop() throws CubeControlException { if (state == State.STOPPED || state == State.PRE_RUNNING || state == State.DESTROYED) { return; } try { lifecycle.fire(new BeforeStop(id)); long currentTime = System.currentTimeMillis(); try { if (configuration.isKillContainer()) { executor.killContainer(id); } else { executor.stopContainer(id); } } catch (NotFoundException e) { } catch (NotModifiedException e) { } this.stoppingTimeInMillis = System.currentTimeMillis() - currentTime; state = State.STOPPED; lifecycle.fire(new AfterStop(id)); } catch (Exception e) { state = State.STOP_FAILED; throw CubeControlException.failedStop(id, e); } }
@Override public void stop() throws CubeControlException { if (state == State.STOPPED || state == State.PRE_RUNNING || state == State.DESTROYED) { return; } try { lifecycle.fire(new BeforeStop(id)); destroyPod(holder.getPod()); try { portBindings.podStopped(); } catch (Exception e) { // this shouldn't prevent normal shutdown behavior } this.state = State.STOPPED; lifecycle.fire(new AfterStop(id)); } catch (Exception e) { this.state = State.STOP_FAILED; throw CubeControlException.failedStop(getId(), e); } }