Examples of ConversationImpl


Examples of org.apache.tuscany.sca.core.context.ConversationImpl

        if (conversational) {
            if (conversation == null) {
                // this is a callback so create a conversation to
                // hold onto the conversation state for the lifetime of the
                // stateful callback
                conversation = new ConversationImpl();
            }
            Object conversationId = conversation.getConversationID();

            // create a conversation id if one doesn't exist
            // already, i.e. the conversation is just starting
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationImpl

        // ----- execute
        // create conversation
        ConversationContext conversationContext = new ConversationContext();
        conversationContext.setActive(true);

        Conversation conversation = new ConversationImpl(session.getId(), getWebBeansContext());
        conversation.begin();

        ConversationManager conversationManager = getWebBeansContext().getConversationManager();
        conversationManager.addConversationContext(conversation, conversationContext);

        getWebBeansContext().registerService(ConversationService.class, new MockConversationService(session, conversation));

        // set sample text
        getInstance(ConversationScopedBean.class, conversationContext).setText(CONVERSATION_SCOPED_SAMPLE_TEXT);

        // store beans in session
        failoverService.sessionIsIdle(session);

        // serialize / deserialize and store deserialized bag back to session
        FailOverBag failOverBag;
        failOverBag = (FailOverBag) session.getAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME);
        failOverBag = (FailOverBag) serialize(failOverBag);

        session.setAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME, failOverBag);

        // remove sample text
        getInstance(ConversationScopedBean.class, conversationContext).setText(null);

        getWebBeansContext().getContextsService().endContext(ConversationScoped.class, conversationContext);

        // restore beans from session
        failoverService.sessionDidActivate(session);



        // ----- assert
        // get and activate conversation
        Map<Conversation, ConversationContext> conversationMap =
                conversationManager.getConversationMapWithSessionId(session.getId());

        Conversation propogatedConversation =
                conversationManager.getPropogatedConversation(conversation.getId(), session.getId());

        ConversationContext propogatedConversationContext =  conversationMap.get(propogatedConversation);
        propogatedConversationContext.setActive(true);

        ConversationScopedBean beanInstance = getInstance(ConversationScopedBean.class, propogatedConversationContext);
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationImpl

            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

Examples of org.apache.webbeans.conversation.ConversationImpl

                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

Examples of org.apache.webbeans.conversation.ConversationImpl

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

Examples of org.apache.webbeans.conversation.ConversationImpl

            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

Examples of org.apache.webbeans.conversation.ConversationImpl

                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

Examples of org.apache.webbeans.conversation.ConversationImpl

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

Examples of org.apache.webbeans.conversation.ConversationImpl

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

        return conversation;
    }
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationImpl

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