Package org.apache.webbeans.spi

Examples of org.apache.webbeans.spi.ContextsService


    public void startApplicationScope() throws Exception
    {
        logger.log(Level.FINE, "starting the OWB ApplicationContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        contextsService.startContext(ApplicationScoped.class, servletContext);
    }
View Full Code Here


    public void startConversationScope() throws Exception
    {
        logger.log(Level.FINE, "starting the OWB ConversationContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        contextsService.startContext(ConversationScoped.class, null);
    }
View Full Code Here

    public void startRequestScope() throws Exception
    {
        logger.log(Level.FINE, "starting the OWB RequestContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        contextsService.startContext(RequestScoped.class, null);
    }
View Full Code Here

    public void startSessionScope() throws Exception
    {
        logger.log(Level.FINE, "starting the OWB SessionContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        contextsService.startContext(SessionScoped.class, session);
    }
View Full Code Here

    public void stopContexts() throws Exception
    {
        logger.log(Level.FINE, "stopping all OWB Contexts");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        stopSessionScope();
        stopConversationScope();
        stopRequestScope();
        stopApplicationScope();
        contextsService.endContext(Singleton.class, null);
    }
View Full Code Here

    public void stopApplicationScope() throws Exception
    {
        logger.log(Level.FINE, "stopping the OWB ApplicationContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();
        contextsService.endContext(ApplicationScoped.class, servletContext);
    }
View Full Code Here

    public void stopConversationScope() throws Exception
    {
        logger.log(Level.FINE, "stopping the OWB ConversationContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();
        contextsService.endContext(ConversationScoped.class, null);
    }
View Full Code Here

    public void stopRequestScope() throws Exception
    {
        logger.log(Level.FINE, "stopping the OWB RequestContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();
        contextsService.endContext(RequestScoped.class, null);
    }
View Full Code Here

    public void stopSessionScope() throws Exception
    {
        logger.log(Level.FINE, "stopping the OWB SessionContext");
        WebBeansContext webBeansContext = WebBeansContext.currentInstance();
        ContextsService contextsService = webBeansContext.getContextsService();

        contextsService.endContext(SessionScoped.class, session);
    }
View Full Code Here

    public void contextEntered(ThreadContext oldContext, ThreadContext newContext) {

        final BeanContext beanContext = newContext.getBeanContext();

        final WebBeansContext webBeansContext = beanContext.getModuleContext().getAppContext().getWebBeansContext();
        final ContextsService contextsService = webBeansContext.getContextsService();

        final Context requestContext = contextsService.getCurrentContext(RequestScoped.class);

        if (requestContext == null) {
            contextsService.startContext(RequestScoped.class, null);
            newContext.set(DestroyContext.class, new DestroyContext(contextsService, newContext));
        }
    }
View Full Code Here

TOP

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

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.