@Override public void start() throws CubeControlException { try { resource = client.create(resource); portBindings.serviceStarted(); this.state = State.STARTED; } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } }
@Override public void start() throws CubeControlException { if (state == State.STARTED || state == State.PRE_RUNNING) { return; } try { lifecycle.fire(new BeforeStart(id)); long currentTime = System.currentTimeMillis(); executor.startContainer(id, configuration); long partialDuration = System.currentTimeMillis() - currentTime; this.startingTimeInMillis = this.startingTimeInMillis + partialDuration; state = State.STARTED; portBindings.containerStarted(); if (!AwaitStrategyFactory.create(executor, this, configuration).await()) { throw new IllegalArgumentException(String.format("Cannot connect to %s container", id)); } lifecycle.fire(new AfterStart(id)); } catch (Exception e) { state = State.START_FAILED; throw CubeControlException.failedStart(id, e); } }
@Override public void start() throws CubeControlException { if (state == State.STARTED || state == State.PRE_RUNNING) { return; } try { lifecycle.fire(new BeforeStart(id)); long currentTime = System.currentTimeMillis(); executor.startContainer(id, configuration); long partialDuration = System.currentTimeMillis() - currentTime; this.startingTimeInMillis = this.startingTimeInMillis + partialDuration; state = State.STARTED; portBindings.containerStarted(); if (!AwaitStrategyFactory.create(executor, this, configuration).await()) { throw new IllegalArgumentException(String.format("Cannot connect to %s container", id)); } lifecycle.fire(new AfterStart(id)); } catch (Exception e) { state = State.START_FAILED; throw CubeControlException.failedStart(id, e); } }
@Override public void start() throws CubeControlException { try { lifecycle.fire(new BeforeStart(id)); holder.setPod(client.createAndWait(holder.getPod())); this.state = State.STARTED; try { portBindings.podStarted(); } catch (Exception e) { try { destroyPod(holder.getPod()); } catch (Exception e1) { } throw e; } lifecycle.fire(new AfterStart(id)); // Add the routes to JVM's name service. ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } }