Package org.apache.webbeans.conversation

Examples of org.apache.webbeans.conversation.ConversationImpl


                {
                    logger.debug("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");
                }
View Full Code Here


        }

        if (conversation.isTransient()) {
            webBeansContext.getContextsService().endContext(ConversationScoped.class, null);
        } else {
            final ConversationImpl conversationImpl = (ConversationImpl) conversation;
            conversationImpl.updateTimeOut();
            conversationImpl.setInUsed(false);
        }
    }
View Full Code Here

                contextFactory.destroyConversationContext();
            }
            else
            {
                //Conversation must be used by one thread at a time
                ConversationImpl owbConversation = (ConversationImpl)conversation;
                owbConversation.updateTimeOut();
                //Other threads can now access propogated conversation.
                owbConversation.setInUsed(false);               
            }           
        }
    }
View Full Code Here

                {
                    logger.debug("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");
                }
View Full Code Here

       
        if (conversation == null)
        {
            if(sessionId != null)
            {
                conversation = new ConversationImpl(conversationService.getConversationSessionId(),
                                                    getWebBeansContext());
            }
            else
            {
                //Used in Tests
                conversation = new ConversationImpl(getWebBeansContext());
            }
           
        }

        return conversation;
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    protected ConversationImpl newInstance(CreationalContextImpl<ConversationImpl> creationalContext)
    {
        ConversationImpl conversation = null;
        //Gets conversation service
        ConversationService conversationService = webBeansContext.getService(ConversationService.class);
        //Gets conversation id
        String conversationId = conversationService.getConversationId();      
        //Gets session id that conversation is created
        String sessionId = conversationService.getConversationSessionId();

        //If conversation id is not null, this means that
        //conversation is propogated
        if (conversationId != null)
        {
            //Gets propogated conversation
            conversation = webBeansContext.getConversationManager().getPropogatedConversation(conversationId, sessionId);
        }
       
        if (conversation == null)
        {
            if(sessionId != null)
            {
                conversation = new ConversationImpl(conversationService.getConversationSessionId(), webBeansContext);
            }
            else
            {
                //Used in Tests
                conversation = new ConversationImpl(webBeansContext);
            }
           
        }

        return conversation;
View Full Code Here

        {
            conversation = ConversationManager.getInstance().getConversation(conversationId);
        }
        else
        {
            conversation = new ConversationImpl(conversationService.getConversationSessionId());
        }

        return conversation;
    }
View Full Code Here

        }

        if (conversation.isTransient()) {
            webBeansContext.getContextsService().endContext(ConversationScoped.class, null);
        } else {
            final ConversationImpl conversationImpl = (ConversationImpl) conversation;
            conversationImpl.updateTimeOut();
            conversationImpl.setInUsed(false);
        }
    }
View Full Code Here

        }

        if (conversation.isTransient()) {
            webBeansContext.getContextsService().endContext(ConversationScoped.class, null);
        } else {
            final ConversationImpl conversationImpl = (ConversationImpl) conversation;
            conversationImpl.updateTimeOut();
            conversationImpl.setInUsed(false);
        }
    }
View Full Code Here

                contextFactory.destroyConversationContext();
            }
            else
            {
                //Conversation must be used by one thread at a time
                ConversationImpl owbConversation = (ConversationImpl)conversation;
                owbConversation.updateTimeOut();
                //Other threads can now access propogated conversation.
                owbConversation.setInUsed(false);               
            }           
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.conversation.ConversationImpl

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.