Examples of ContextFactory


Examples of org.apache.webbeans.context.ContextFactory

            //Otherwise create NonexistentException
            WebBeansContext webBeansContext = WebBeansContext.getInstance();
            ConversationManager conversationManager = webBeansContext.getConversationManager();
            Conversation conversation = conversationManager.getConversationBeanReference();
            String cid = JSFUtil.getConversationId();
            ContextFactory contextFactory = webBeansContext.getContextFactory();

            if (conversation.isTransient())
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Creating a new transitional conversation with cid : [{0}]", conversation.getId());
                }
                contextFactory.initConversationContext(null);

                //Not restore, throw exception
                if(cid != null && !cid.equals(""))
                {
                    throw new NonexistentConversationException("Propogated conversation with cid=" + cid + " is not restored. It creates a new transient conversation.");
                }
            }
            else
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Restoring conversation with cid : [{0}]", conversation.getId());
                }

                //Conversation must be used by one thread at a time
                ConversationImpl owbConversation = (ConversationImpl)conversation;
                if(!owbConversation.getInUsed().compareAndSet(false, true))
                {
                    contextFactory.initConversationContext(null);
                    //Throw Busy exception
                    throw new BusyConversationException("Propogated conversation with cid=" + cid + " is used by other request. It creates a new transient conversation");
                }
                else
                {
                    ConversationContext conversationContext = conversationManager.getConversationContext(conversation);
                    contextFactory.initConversationContext(conversationContext);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

{

    public AbstractContext getRequestContext()
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        RequestContext ctx =  (RequestContext)contextFactory.getStandardContext(RequestScoped.class);
       
        if(ctx == null)
        {
            contextFactory.initRequestContext(null);
        }
       
        return (AbstractContext) contextFactory.getStandardContext(RequestScoped.class);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

    }

    public AbstractContext getDependentContext()
    {
        WebBeansContext webBeansContext = WebBeansContext.getInstance();
        ContextFactory contextFactory = webBeansContext.getContextFactory();

        return (AbstractContext) contextFactory.getStandardContext(Dependent.class);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

* @version $Rev$ $Date$
*/
public class ContextsImpl implements org.jboss.jsr299.tck.spi.Contexts<AbstractContext> {

    public AbstractContext getRequestContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        RequestContext ctx = (RequestContext) contextFactory.getStandardContext(RequestScoped.class);

        if (ctx == null) {
            contextFactory.initRequestContext(null);
        }

        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.REQUEST);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

    public void setInactive(AbstractContext context) {
        context.setActive(false);
    }

    public AbstractContext getDependentContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.DEPENDENT);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

* @version $Rev$ $Date$
*/
public class ContextsImpl implements org.jboss.jsr299.tck.spi.Contexts<AbstractContext> {

    public AbstractContext getRequestContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        RequestContext ctx = (RequestContext) contextFactory.getStandardContext(RequestScoped.class);

        if (ctx == null) {
            contextFactory.initRequestContext(null);
        }

        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.REQUEST);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

    public void setInactive(AbstractContext context) {
        context.setActive(false);
    }

    public AbstractContext getDependentContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.DEPENDENT);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

* @version $Rev$ $Date$
*/
public class ContextsImpl implements org.jboss.jsr299.tck.spi.Contexts<AbstractContext> {

    public AbstractContext getRequestContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        RequestContext ctx = (RequestContext) contextFactory.getStandardContext(RequestScoped.class);

        if (ctx == null) {
            contextFactory.initRequestContext(null);
        }

        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.REQUEST);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

    public void setInactive(AbstractContext context) {
        context.setActive(false);
    }

    public AbstractContext getDependentContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.DEPENDENT);
    }
View Full Code Here

Examples of org.apache.webbeans.context.ContextFactory

* @version $Rev$ $Date$
*/
public class ContextsImpl implements org.jboss.jsr299.tck.spi.Contexts<AbstractContext> {

    public AbstractContext getRequestContext() {
        ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
        RequestContext ctx = (RequestContext) contextFactory.getStandardContext(RequestScoped.class);

        if (ctx == null) {
            contextFactory.initRequestContext(null);
        }

        return (AbstractContext) contextFactory.getStandardContext(ContextTypes.REQUEST);
    }
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.