public void remapContainer(@Observes BeforeSetup event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry) throws InstantiationException, IllegalAccessException { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) {
public void remapContainer(@Observes BeforeSetup event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry) throws InstantiationException, IllegalAccessException { Container container = ContainerUtil.getContainerByDeployableContainer(containerRegistry, event.getDeployableContainer()); if (container == null) {
public void stopCubeMappedContainer(@Observes AfterStop event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry) { 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 } controlEvent.fire(new StopCube(cube)); controlEvent.fire(new DestroyCube(cube)); } }
public void stopCubeMappedContainer(@Observes AfterStop event, CubeRegistry cubeRegistry, ContainerRegistry containerRegistry) { 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 } controlEvent.fire(new StopCube(cube)); controlEvent.fire(new DestroyCube(cube)); } }
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 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)); } }