Package org.apache.webbeans.spi

Examples of org.apache.webbeans.spi.ContainerLifecycle


        service.startContext(ConversationScoped.class, null);
    }

    public void afterMethod(@Observes After event)
    {
        ContainerLifecycle lc = lifecycle.get();
        if (lc == null)
        {
            // this may happen if there was a DeploymentError during CDI boot
            return;
        }

        ContextsService service = lc.getContextService();

        service.endContext(ConversationScoped.class, null);
        service.endContext(SessionScoped.class, null);
        service.endContext(RequestScoped.class, null);
    }
View Full Code Here


        webBeansContext = WebBeansContext.getInstance();

        LOG.fine("OpenWebBeans Arquillian starting deployment");

        ContainerLifecycle lifecycle = webBeansContext.getService(ContainerLifecycle.class);

        lifecycleProducer.set(lifecycle);
        beanManagerProducer.set(lifecycle.getBeanManager());

        OwbArquillianScannerService dummyScannerService = (OwbArquillianScannerService) webBeansContext.getScannerService();
        dummyScannerService.setArchive(archive);

        lifecycle.startApplication(null);

        return new ProtocolMetaData();
    }
View Full Code Here

    {
        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);
        }
    }
View Full Code Here

       *
      ClassLoader cl = new ShrinkWrapClassLoader(archive);
      Thread.currentThread().setContextClassLoader(cl);
       */
      final ShrinkWrapMetaDataDiscovery discovery = new ShrinkWrapMetaDataDiscovery(archive);
      ContainerLifecycle lifecycle = new StandaloneLifeCycle()
      {
         /**
          * Override so we can set out own scannerService.
          * TODO: We should change this to use the ServiceLoader via openwebbeans.properties, then do something like:
          * ((ShrinkWrapScannerService)StandardLifecycle.getScannerService()).setArchive(deployment)
          */
         @Override
         protected void afterInitApplication(Properties properties)
         {
            super.afterInitApplication(properties);
            this.scannerService = discovery;
         }
      };

      try
      {
         lifecycle.startApplication(null);
      }
      catch (Exception e)
      {
         throw new RuntimeException("Failed to start standalone OpenWebBeans container", e);
      }

      lifecycleProducer.set(lifecycle);
      beanManagerProducer.set(lifecycle.getBeanManager());
     
      return new ProtocolMetaData();
   }
View Full Code Here

   /**
    * @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());
      }
   }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.spi.ContainerLifecycle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.