public void changeToPreRunning(@Observes PreRunningCube event, CubeRegistry registry) { validateAndGet(registry, event.getCubeId()).changeToPreRunning(); }
@Override public RuntimeException call() throws Exception { try { if (connectionMode.isAllowReconnect() && isCubeRunning(cubeId)) { controlEvent.fire(new PreRunningCube(cubeId)); return null; } controlEvent.fire(new CreateCube(cubeId)); controlEvent.fire(new StartCube(cubeId)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cubeId)); } } catch (RuntimeException e) { return e; } return null; } }
@Override public RuntimeException call() throws Exception { try { if (connectionMode.isAllowReconnect() && isCubeRunning(cubeId)) { controlEvent.fire(new PreRunningCube(cubeId)); return null; } controlEvent.fire(new CreateCube(cubeId)); controlEvent.fire(new StartCube(cubeId)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cubeId)); } } catch (RuntimeException e) { return e; } return null; } }
public void startCubeMappedContainer(@Observes BeforeStart event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry, CubeConfiguration cubeConfiguration) { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) { return; } Cube<?> cube = cubeRegistry.getCube(ContainerUtil.getCubeIDForContainer(container)); if (cube == null) { return; // No Cube found matching Container name, not managed by Cube } ConnectionMode connectionMode = cubeConfiguration.getConnectionMode(); if (connectionMode.isAllowReconnect() && cube.isRunningOnRemote()) { controlEvent.fire(new PreRunningCube(cube)); return; } controlEvent.fire(new CreateCube(cube)); controlEvent.fire(new StartCube(cube)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cube)); } }
public void changeToPreRunning(@Observes PreRunningCube event, CubeRegistry registry) { validateAndGet(registry, event.getCubeId()).changeToPreRunning(); }
public void startCubeMappedContainer(@Observes BeforeStart event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry, CubeConfiguration cubeConfiguration) { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) { return; } Cube<?> cube = cubeRegistry.getCube(ContainerUtil.getCubeIDForContainer(container)); if (cube == null) { return; // No Cube found matching Container name, not managed by Cube } ConnectionMode connectionMode = cubeConfiguration.getConnectionMode(); if (connectionMode.isAllowReconnect() && cube.isRunningOnRemote()) { controlEvent.fire(new PreRunningCube(cube)); return; } controlEvent.fire(new CreateCube(cube)); controlEvent.fire(new StartCube(cube)); if (connectionMode.isAllowReconnect() && !connectionMode.isStoppable()) { // If we allow reconnections and containers are none stoppable which means that they will be able to be // reused in next executions then at this point we can assume that the container is a prerunning container. controlEvent.fire(new PreRunningCube(cube)); } }