Package org.apache.webbeans.context

Examples of org.apache.webbeans.context.ConversationContext


    {
        if (context == null)
        {
            if(conversationContexts.get() == null)
            {
                ConversationContext newContext = new ConversationContext();
                newContext.setActive(true);
               
                conversationContexts.set(newContext);
            }
            else
            {
View Full Code Here


    /**
     * Destroy conversation context.
     */
    private void destroyConversationContext()
    {
        ConversationContext context = getConversationContext();

        if (context != null)
        {
            context.destroy();
        }

        conversationContexts.set(null);
        conversationContexts.remove();
    }
View Full Code Here

        while (it.hasNext())
        {
            conv = (ConversationImpl) it.next();
            if (conv.getSessionId().equals(sessionId))
            {
                ConversationContext ctx = getConversationContext(conv);
                if (ctx != null)
                {
                    ctx.destroy();
                }
                it.remove();
            }
        }
    }
View Full Code Here

            if (timeout != 0L)
            {
                if ((System.currentTimeMillis() - conv.getActiveTime()) > timeout)
                {
                    ConversationContext ctx = getConversationContext(conv);
                    if (ctx != null)
                    {
                        if(logger.isLoggable(Level.INFO))
                        {
                            logger.log(Level.INFO, OWBLogConst.INFO_0011, conv.getId());
                        }
                        ctx.destroy();
                    }

                    it.remove();
                }
            }
View Full Code Here

                    //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

            }
        }

        else if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
        {
            ConversationContext context = (ConversationContext) ManagerImpl.getManager().getContext(ConversationScoped.class);

            // if long running, saves it
            if (conversation.isLongRunning())
            {
                logger.info("Conversation with id : " + conversation.getId() + " is marked as long running conversation");
                context.setActive(false);
            }

            // else destroy cınversation context
            else
            {
                logger.info("Destroying the conversation context for view id : " + JSFUtil.getViewId());
                context.destroy();
            }

        }

    }
View Full Code Here

    public void beforePhase(PhaseEvent phaseEvent)
    {
        if (phaseEvent.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES))
        {
            ConversationContext context = (ConversationContext) manager.getContext(ConversationScoped.class);

            if (JSFUtil.isPostBack())
            {
                logger.info("Activating the conversation context for view id : " + JSFUtil.getViewId());
                context.setActive(true);

                conversation.updateTimeOut();
            }
        }

        else if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
        {
            ConversationContext context = (ConversationContext) manager.getContext(ConversationScoped.class);

            if (!JSFUtil.isPostBack())
            {
                logger.info("Activating the conversation context for view id : " + JSFUtil.getViewId());
                context.setActive(true);

                conversation.updateTimeOut();
            }

            if (conversation.isLongRunning())
View Full Code Here

            }
        }

        else if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
        {
            ConversationContext context = (ConversationContext) ManagerImpl.getManager().getContext(ConversationScoped.class);

            // if long running, saves it
            if (conversation.isLongRunning())
            {
                logger.info("Conversation with id : " + conversation.getId() + " is marked as long running conversation");
               
                context.setActive(false);
               
            }

            // else destroy conversation context
            else
View Full Code Here

            }           
        }

        else if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE))
        {
            ConversationContext context = (ConversationContext) ManagerImpl.getManager().getContext(ConversationScoped.class);

            if (!JSFUtil.isPostBack())
            {
                logger.info("Activating the conversation context for view id : " + JSFUtil.getViewId());
                context.setActive(true);

                conversation.updateTimeOut();
            }

            if (conversation.isLongRunning())
View Full Code Here

        while (it.hasNext())
        {
            conv = (ConversationImpl) it.next();
            if (conv.getSessionId().equals(sessionId))
            {
                ConversationContext ctx = getConversationContext(conv);
                if (ctx != null)
                {
                    ctx.destroy();
                }
                it.remove();
            }
        }
    }
View Full Code Here

TOP

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

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.