Package org.apache.webbeans.context

Examples of org.apache.webbeans.context.ContextFactory


    @Override
    public void startConversationScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.initConversationContext(null);
    }
View Full Code Here


    @Override
    public void startRequestScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.initRequestContext(null);
    }
View Full Code Here

    @Override
    public void startSessionScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.initSessionContext(session);
    }
View Full Code Here

    @Override
    public void stopContexts() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.destroyRequestContext(null);
        contextFactory.destroyConversationContext();
        contextFactory.destroySessionContext(session);
        contextFactory.destroyApplicationContext(servletContext);
        contextFactory.destroySingletonContext(servletContext);

        //Comment out for OWB-502
        //ContextFactory.cleanUpContextFactory();
    }
View Full Code Here

        getComponents().clear();

        defineInterceptor(WebBeansInterceptor.class);
        defineManagedBean(WInterceptorComponent.class);

        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        contextFactory.initRequestContext(null);
        List<AbstractOwbBean<?>> comps = getComponents();

        Object object = getManager().getInstance(comps.get(0));

        Assert.assertTrue(object instanceof WInterceptorComponent);

        WInterceptorComponent comp = (WInterceptorComponent) object;
        int s = comp.hello();

        Assert.assertEquals(5, s);

        contextFactory.destroyRequestContext(null);
    }
View Full Code Here

    @Override
    public void stopApplicationScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.destroyApplicationContext(servletContext);
    }
View Full Code Here

        defineInterceptor(WebBeansInterceptor.class);
        defineInterceptor(WebBeanswithMetaInterceptor.class);
        defineManagedBean(WMetaInterceptorComponent.class);

        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        contextFactory.initRequestContext(null);
        List<AbstractOwbBean<?>> comps = getComponents();

        Object object = getManager().getInstance(comps.get(0));

        Assert.assertTrue(object instanceof WMetaInterceptorComponent);

        WMetaInterceptorComponent comp = (WMetaInterceptorComponent) object;
        int s = comp.hello();

        Assert.assertEquals(5, s);

        s = comp.hello2();

        Assert.assertEquals(10, s);

        contextFactory.destroyRequestContext(null);
    }
View Full Code Here

    @Override
    public void stopConversationScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.destroyConversationContext();
    }
View Full Code Here

    @Override
    public void stopRequestScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.destroyRequestContext(null);
    }
View Full Code Here

    @Override
    public void stopSessionScope() throws Exception
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        contextFactory.destroySessionContext(session);
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.context.ContextFactory

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.