@SuppressWarnings("unchecked") @Override public Void call() throws Exception { delegate.undeploy(archive); return null; } });
@Override public Void call() throws Exception { delegate.deploy(descriptor); return null; } });
@SuppressWarnings("unchecked") public Class<ContainerConfiguration> getConfigurationClass() { return delegate.getConfigurationClass(); }
/** * Check if this Container DEFAULTs to the Local protocol. * <p/> * Hack to get around ARQ-391 * * @return true if DeployableContianer.getDefaultProtocol == Local */ public static boolean isLocalContainer(Container container) { if (container == null || container.getDeployableContainer() == null || container.getDeployableContainer().getDefaultProtocol() == null) { return false; } return "Local".equals(container.getDeployableContainer().getDefaultProtocol().getName()); } }
@Before public void setup() throws Exception { when(deployableContainer1.deploy(isA(Archive.class))).thenReturn(protocolMetaData); when(deployableContainer1.getConfigurationClass()).thenReturn(DummyContainerConfiguration.class); when(deployableContainer2.deploy(isA(Archive.class))).thenReturn(protocolMetaData); when(deployableContainer2.getConfigurationClass()).thenReturn(DummyContainerConfiguration.class); when(serviceLoader.onlyOne(eq(DeployableContainer.class))).thenReturn(deployableContainer1, deployableContainer2); when(container1.getContainerName()).thenReturn(CONTAINER_1_NAME);
@Override public Void call() throws Exception { delegate.stop(); return null; } });
@Override public Void call() throws Exception { delegate.start(); return null; } });
public void setup() throws IOException { deployableContainer = loadDeployableContainer(); manager = (ManagerBuilder.from()).extension(LoadableExtensionLoader.class).create(); manager.getContext(ContainerContext.class).activate("AS7 Managed"); configuration = new ManagedContainerConfiguration(); configuration.setJavaVmArguments(System.getProperty("jboss.options")); manager.inject(deployableContainer); deployableContainer.setup(configuration); try { deployableContainer.start(); } catch (LifecycleException e) { throw new RuntimeException(e); } }
@SuppressWarnings("unchecked") @Override public Void call() throws Exception { delegate.setup(configuration); return null; } });
/** * Check if this Container DEFAULTs to the Local protocol. * <p> * Hack to get around ARQ-391 * * @return true if DeployableContianer.getDefaultProtocol == Local */ public static boolean isLocalContainer(Container container) { if ( container == null || container.getDeployableContainer() == null || container.getDeployableContainer().getDefaultProtocol() == null) { return false; } if (LocalProtocol.NAME.equals(container.getDeployableContainer().getDefaultProtocol().getName())) { return true; } return false; } }
@Override public Void call() throws Exception { delegate.stop(); return null; } });
@Override public Void call() throws Exception { delegate.start(); return null; } });
@Test public void shouldNotStartCustomContainersInRegistry() throws Exception { registry.create(container5, serviceLoader).setState(Container.State.STOPPED); fire(new SetupContainers()); verify(deployableContainer, times(1)).setup(isA(DummyContainerConfiguration.class)); fire(new StartSuiteContainers()); verify(deployableContainer, times(0)).start(); fire(new StartClassContainers()); verify(deployableContainer, times(0)).start(); Assert.assertEquals(Container.State.SETUP, registry.getContainer(CONTAINER_5_NAME).getState()); }
@SuppressWarnings("unchecked") @Override public Void call() throws Exception { delegate.setup(configuration); return null; } });
@SuppressWarnings("unchecked") public Class<ContainerConfiguration> getConfigurationClass() { return delegate.getConfigurationClass(); }
@Override public Void call() throws Exception { delegate.undeploy(descriptor); return null; } });
@SuppressWarnings("unchecked") @Override public ProtocolMetaData call() throws Exception { return delegate.deploy(archive); } });
/** * Check if this Container DEFAULTs to the Local protocol. * <p> * Hack to get around ARQ-391 * * @return true if DeployableContianer.getDefaultProtocol == Local */ public static boolean isLocalContainer(Container container) { if ( container == null || container.getDeployableContainer() == null || container.getDeployableContainer().getDefaultProtocol() == null) { return false; } if (LocalProtocol.NAME.equals(container.getDeployableContainer().getDefaultProtocol().getName())) { return true; } return false; } }
public void cleanup() throws IOException { try { deployableContainer.stop(); } catch (LifecycleException e) { throw new RuntimeException(e); } }