public static void undeploy(final DeployableContainer<?> container, final Collection<Archive<?>> containerArchives) { if (containerArchives != null) { for (final Archive<?> a : containerArchives) { try { container.undeploy(a); } catch (final DeploymentException e) { Logger.getLogger(container.getClass().getName()).log(Level.SEVERE, e.getMessage(), e); } } } }
@Override public void start() throws LifecycleException { try { initialContext = new InitialContext(properties); } catch (final NamingException e) { throw new LifecycleException("can't start the OpenEJB container", e); } assembler = SystemInstance.get().getComponent(Assembler.class); configurationFactory = (ConfigurationFactory) SystemInstance.get().getComponent(OpenEjbConfigurationFactory.class); if ("true".equalsIgnoreCase(PROPERTIES.getProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE)) && SystemInstance.get().getComponent(WebAppBuilder.class) == null) { SystemInstance.get().setComponent(WebAppBuilder.class, new LightweightWebAppBuilder()); } contextProducer.set(initialContext); containerArchives = ArquillianUtil.toDeploy(properties); for (final Archive<?> archive : containerArchives) { try { quickDeploy(archive, testClass.get()); } catch (final DeploymentException e) { Logger.getLogger(OpenEJBDeployableContainer.class.getName()).log(Level.SEVERE, e.getMessage(), e); } } }
@Override public void start() throws LifecycleException { try { initialContext = new InitialContext(properties); } catch (final NamingException e) { throw new LifecycleException("can't start the OpenEJB container", e); } assembler = SystemInstance.get().getComponent(Assembler.class); configurationFactory = (ConfigurationFactory) SystemInstance.get().getComponent(OpenEjbConfigurationFactory.class); if ("true".equalsIgnoreCase(PROPERTIES.getProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE)) && SystemInstance.get().getComponent(WebAppBuilder.class) == null) { SystemInstance.get().setComponent(WebAppBuilder.class, new LightweightWebAppBuilder()); } contextProducer.set(initialContext); containerArchives = ArquillianUtil.toDeploy(properties); final Closeables globalScopeCloseables = new Closeables(); SystemInstance.get().setComponent(Closeables.class, globalScopeCloseables); for (final Archive<?> archive : containerArchives) { try { quickDeploy(archive, testClass.get(), globalScopeCloseables); } catch (final DeploymentException e) { Logger.getLogger(OpenEJBDeployableContainer.class.getName()).log(Level.SEVERE, e.getMessage(), e); } } }