Package org.apache.openejb.cdi

Examples of org.apache.openejb.cdi.OpenEJBLifecycle


        services.put(ContextsService.class, new CdiAppContextsService(true));
        services.put(ResourceInjectionService.class, new CdiResourceInjectionService());
        services.put(ScannerService.class, new CdiScanner());
        WebBeansContext webBeansContext = new WebBeansContext(services, properties);
        //must be last since it copies stuff
        OpenEJBLifecycle lifecycle = new OpenEJBLifecycle(webBeansContext);
        webBeansContext.registerService(ContainerLifecycle.class, lifecycle);

        WebBeansContext oldContext = GeronimoSingletonService.contextEntered(webBeansContext);
        try {
            //from OWB's WebBeansConfigurationListener

            try {
                if (startup == null) {
                    //this should only be used for servlet tests
                    StartupObject startupObject = new StartupObject(new AppContext("none", SystemInstance.get(), Thread.currentThread().getContextClassLoader(), null, null, true), new AppInfo(), Collections.<BeanContext>emptyList());
                    lifecycle.startApplication(startupObject);
//                        lifecycle.startServletContext((ServletContext)startup);
                } else if (startup instanceof StartupObject) {
                    lifecycle.startApplication(startup);
//                        ((StartupObject)startup).getAppContext().setWebBeansContext(webBeansContext);
                }
            } catch (Exception e) {
                //             logger.error(OWBLogConst.ERROR_0018, event.getServletContext().getContextPath());
                WebBeansUtil.throwRuntimeExceptions(e);
View Full Code Here


    }

    public static void initializeServletContext(WebBeansContext webBeansContext, ServletContext servletContext) {
        WebBeansContext oldContext = GeronimoSingletonService.contextEntered(webBeansContext);
        try {
            OpenEJBLifecycle lifecycle = (OpenEJBLifecycle) webBeansContext.getService(ContainerLifecycle.class);
            lifecycle.startServletContext(servletContext);
        } finally {
            GeronimoSingletonService.contextExited(oldContext);
        }
    }
View Full Code Here

        services.put(ContextsService.class, new CdiAppContextsService(true));
        services.put(ResourceInjectionService.class, new CdiResourceInjectionService());
        services.put(ScannerService.class, new CdiScanner());
        WebBeansContext webBeansContext = new WebBeansContext(services, properties);
        //must be last since it copies stuff
        OpenEJBLifecycle lifecycle = new OpenEJBLifecycle(webBeansContext);
        webBeansContext.registerService(ContainerLifecycle.class, lifecycle);

        WebBeansContext oldContext = GeronimoSingletonService.contextEntered(webBeansContext);
        //from OWB's WebBeansConfigurationListener
        try {
            if (startup == null) {
                //this should only be used for servlet tests
                StartupObject startupObject = new StartupObject(new AppContext("none", SystemInstance.get(), Thread.currentThread().getContextClassLoader(), null, null, true), new AppInfo(),
                        Collections.<BeanContext> emptyList());
                lifecycle.startApplication(startupObject);
                //lifecycle.startServletContext((ServletContext)startup);
            } else if (startup instanceof StartupObject) {
                lifecycle.startApplication(startup);
                //((StartupObject)startup).getAppContext().setWebBeansContext(webBeansContext);
            }
        } catch (Exception e) {
            //logger.error(OWBLogConst.ERROR_0018, event.getServletContext().getContextPath());
            WebBeansUtil.throwRuntimeExceptions(e);
View Full Code Here

    }

    public static ScheduledExecutorService initializeServletContext(WebBeansContext webBeansContext, ServletContext servletContext) {
        WebBeansContext oldContext = GeronimoSingletonService.contextEntered(webBeansContext);
        try {
            OpenEJBLifecycle lifecycle = (OpenEJBLifecycle) webBeansContext.getService(ContainerLifecycle.class);
            //lifecycle.startServletContext(servletContext);
            //startServletContext will eventually call the static method  initializeServletContext, which will return a ThreadPool reference
            //We do need to keep that reference to prevent the thread leak
            return OpenEJBLifecycle.initializeServletContext(servletContext, webBeansContext);
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.openejb.cdi.OpenEJBLifecycle

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.