Package org.apache.deltaspike.cdise.api

Examples of org.apache.deltaspike.cdise.api.ContextControl.startContext()


                    try
                    {
                        //force a clean context - TODO discuss onScopeStopped call
                        contextControl.stopContext(scopeAnnotation);

                        contextControl.startContext(scopeAnnotation);
                        this.startedScopes.add(scopeAnnotation);

                        onScopeStarted(scopeAnnotation);
                    }
                    catch (RuntimeException e)
View Full Code Here


    {
        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
        cdiContainer.boot();

        ContextControl contextControl = cdiContainer.getContextControl();
        contextControl.startContext(ApplicationScoped.class);

        SettingsBean settingsBean = BeanProvider.getContextualReference(SettingsBean.class, false);

        LOG.info("configured int-value #1: " + settingsBean.getIntProperty1());
        LOG.info("configured long-value #2: " + settingsBean.getProperty2());
View Full Code Here

    {
        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
        cdiContainer.boot();

        ContextControl contextControl = cdiContainer.getContextControl();
        contextControl.startContext(ApplicationScoped.class);

        GlobalResultHolder globalResultHolder =
            BeanProvider.getContextualReference(GlobalResultHolder.class);

        while (globalResultHolder.getCount() < 100)
View Full Code Here

        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
        cdiContainer.boot();

        ContextControl contextControl = cdiContainer.getContextControl();
        contextControl.startContext(ApplicationScoped.class);
        //containerControl.startContexts();

        //or:
        //cdiContainer.start();
View Full Code Here

                try
                {
                    //force a clean context - TODO discuss onScopeStopped call
                    contextControl.stopContext(scopeAnnotation);

                    contextControl.startContext(scopeAnnotation);
                    this.startedScopes.add(scopeAnnotation);

                    onScopeStarted(scopeAnnotation);
                }
                catch (RuntimeException e)
View Full Code Here

    public void requestInitialized(ServletRequestEvent servletRequestEvent)
    {
        LOG.log(Level.FINER,"Incoming request.");
        ContextControl contextControl = getContextControl();
        servletRequestEvent.getServletRequest().setAttribute(CDI_REQ_CONTEXT, contextControl);
        contextControl.startContext(RequestScoped.class);
    }

    private ContextControl getContextControl()
    {
        CdiContainer container = CdiContainerLoader.getCdiContainer();
View Full Code Here

        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
        cdiContainer.boot();

        // Starting the application-context allows to use @ApplicationScoped beans
        ContextControl contextControl = cdiContainer.getContextControl();
        contextControl.startContext(ApplicationScoped.class);

        MainApplication main = BeanProvider.getContextualReference(MainApplication.class, false);

        main.run();
        // Stop de CDI container
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.