@Override public void stop() { lifecycle.stopApplication(null); }
@Override public void shutdownContainer() throws Exception { if (lifecycle != null) { lifecycle.stopApplication(new ServletContextEvent(servletContext)); } }
@Override public void moduleDestoryed(ServletContext servletContext) { if (this.lifeCycle != null) { this.lifeCycle.stopApplication(new ServletContextEvent(servletContext)); this.lifeCycle = null; } if (service != null) { service.shutdownNow(); } this.webBeansContext = null; }
/** * {@inheritDoc} */ @Override public void contextDestroyed(ServletContextEvent event) { if (lifeCycle != null) { lifeCycle.stopApplication(event); } // just to be sure that we didn't lazily create anything... cleanupRequestThreadLocals(); }
/** * @see org.jboss.arquillian.spi.client.container.DeployableContainer#undeploy(org.jboss.shrinkwrap.api.Archive) */ public void undeploy(final Archive<?> archive) throws DeploymentException { ContainerLifecycle lifecycle = lifecycleProducer.get(); if (lifecycle != null) { // end the session lifecycle lifecycle.stopApplication(null); //Thread.currentThread().setContextClassLoader(Thread.currentThread().getContextClassLoader().getParent()); } } }
protected void doClose() { context.getService(ContainerLifecycle.class).stopApplication(startEvent); }
public void start() throws InterruptedException { log.info(OWBLogConst.INFO_0005); long begin = System.currentTimeMillis(); containerLifecycle.startApplication(properties); Runtime.getRuntime().addShutdownHook(new Thread(){ @Override public void run() { latch.countDown(); } }); log.log(Level.INFO, OWBLogConst.INFO_0001, Long.toString(System.currentTimeMillis() - begin)); latch.await(); log.info(OWBLogConst.INFO_0008); containerLifecycle.stopApplication(properties); log.info(OWBLogConst.INFO_0009); }
/** * {@inheritDoc} */ @Override public void destroy() { if (startOwb) { this.lifeCycle.stopApplication(new ServletContextEvent(this.servletContext)); this.lifeCycle = null; this.servletContext = null; // just to be sure that we didn't lazily create anything... cleanupRequestThreadLocals(); } }
@Override public void undeploy(Archive<?> archive) throws DeploymentException { LOG.fine("OpenWebBeans Arquillian undeploying"); OwbArquillianScannerService dummyScannerService = (OwbArquillianScannerService) webBeansContext.getScannerService(); dummyScannerService.clear(); ContainerLifecycle lifecycle = lifecycleProducer.get(); if (lifecycle != null) { // end the session lifecycle lifecycle.stopApplication(null); } ClassLoader current = Thread.currentThread().getContextClassLoader(); if (OwbSWClassLoader.class.isInstance(current)) { // should be the case try { OwbSWClassLoader.class.cast(current).close(); } catch (IOException e) { // no-op } } Thread.currentThread().setContextClassLoader(originalLoader.get()); originalLoader.remove(); }
@AfterClass public static void stopContainer() { lifecycle.stopApplication(null); }
@After public void tearDown() { lifecycle.stopApplication(event); }
@Override public synchronized void shutdown() { if (ctxCtrl != null) { try { ctxCtrl.stopContexts(); } catch (Exception e) { // contexts likely already stopped } ctxCtrlBean.destroy(ctxCtrl, ctxCtrlCreationalContext); ctxCtrl = null; } if (lifecycle != null) { Object mockServletContextEvent = null; if (OpenWebBeansContextControl.isServletApiAvailable()) { mockServletContextEvent = OwbHelper.getMockServletContextEvent(); } lifecycle.stopApplication(mockServletContextEvent); } lifecycle = null; }
@Override public synchronized void shutdown() { if (ctxCtrl != null) { try { ctxCtrl.stopContexts(); } catch (Exception e) { // contexts likely already stopped } ctxCtrlBean.destroy(ctxCtrl, ctxCtrlCreationalContext); ctxCtrl = null; } if (lifecycle != null) { Object mockServletContextEvent = null; if (OpenWebBeansContextControl.isServletApiAvailable()) { mockServletContextEvent = OwbHelper.getMockServletContextEvent(); } lifecycle.stopApplication(mockServletContextEvent); } lifecycle = null; }
Thread.currentThread().setContextClassLoader(classLoader); try { webBeansContext.getService(ContainerLifecycle.class).stopApplication(null); } finally { Thread.currentThread().setContextClassLoader(old);
final ServletContext context = appContext.isStandaloneModule() && appContext.getWebContexts().iterator().hasNext() ? appContext.getWebContexts().iterator().next().getServletContext() : null; webBeansContext.getService(ContainerLifecycle.class).stopApplication(context); } finally { Thread.currentThread().setContextClassLoader(old);