@Test public void shouldFireLifecycleEventsDuringStart() { buildablePodCube.start(); assertEventFired(BeforeStart.class, 1); assertEventFired(AfterStart.class, 1); }
@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)); ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } }
BuildablePodCube extends BaseCube<Void> { @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)); ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } } }
BuildablePodCube extends BaseCube<Void> { @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)); ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); }
BuildablePodCube extends BaseCube<Void> { @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)); ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); @Override State state(); @Override String getId(); @Override void create(); @Override void start(); @Override void stop(); @Override void destroy(); @Override boolean isRunningOnRemote(); @Override void changeToPreRunning(); @Override Binding bindings(); @Override Binding configuredBindings(); @Override Void configuration(); }
BuildablePodCube extends BaseCube<Void> { @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)); ArqCubeNameService.setRoutes(client.getClientExt().routes().list(), this.configuration.getRouterHost()); } catch (Exception e) { this.state = State.START_FAILED; throw CubeControlException.failedStart(getId(), e); } } BuildablePodCube(Pod resource, OpenShiftClient client, CubeOpenShiftConfiguration configuration); @Override State state(); @Override String getId(); @Override void create(); @Override void start(); @Override void stop(); @Override void destroy(); @Override boolean isRunningOnRemote(); @Override void changeToPreRunning(); @Override Binding bindings(); @Override Binding configuredBindings(); @Override Void configuration();  }