@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void perform(Container container) { stopContainer.fire(new StopContainer(container)); } });
@Override public void stop(String containerQualifier) { DeploymentScenario scenario = deploymentScenario.get(); if (scenario == null) { throw new IllegalArgumentException("No deployment scenario in context"); } ContainerRegistry registry = containerRegistry.get(); if (registry == null) { throw new IllegalArgumentException("No container registry in context"); } if (!containerExists(registry.getContainers(), containerQualifier)) { throw new IllegalArgumentException("No container with the specified name exists"); } if (!isControllableContainer(registry.getContainers(), containerQualifier)) { throw new IllegalArgumentException("Could not stop " + containerQualifier + " container. The container life cycle is controlled by Arquillian"); } Container container = registry.getContainer(new TargetDescription(containerQualifier)); List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier)); for (Deployment d : managedDeployments) { if (d.isDeployed()) { log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() + " from the container with name " + container.getName()); event.fire(new UnDeployDeployment(container, d)); } } log.info("Manual stopping of a server instance"); event.fire(new StopContainer(container)); }
@Override public void stop(String containerQualifier) { DeploymentScenario scenario = deploymentScenario.get(); if (scenario == null) { throw new IllegalArgumentException("No deployment scenario in context"); } ContainerRegistry registry = containerRegistry.get(); if (registry == null) { throw new IllegalArgumentException("No container registry in context"); } if (!containerExists(registry.getContainers(), containerQualifier)) { throw new IllegalArgumentException("No container with the specified name exists"); } if (!isControllableContainer(registry.getContainers(), containerQualifier)) { throw new IllegalArgumentException("Could not stop " + containerQualifier + " container. The container life cycle is controlled by Arquillian"); } Container container = registry.getContainer(new TargetDescription(containerQualifier)); List<Deployment> managedDeployments = scenario.startupDeploymentsFor(new TargetDescription(containerQualifier)); for (Deployment d : managedDeployments) { if (d.isDeployed()) { log.info("Automatic undeploying of the managed deployment with name " + d.getDescription().getName() + " from the container with name " + container.getName()); event.fire(new UnDeployDeployment(container, d)); } } log.info("Manual stopping of a server instance"); event.fire(new StopContainer(container)); }