/** * Initialize conversation context. * @param startObject either a ServletRequest or a ConversationContext */ protected void initConversationContext(Object startObject) { if (conversationContexts.get() != null) { return; } if (startObject instanceof ConversationContext) { //X TODO check if this branch is still needed ConversationContext context = (ConversationContext) startObject; context.setActive(true); conversationContexts.set(context); } }
/** * Initialize conversation context. * * @param context context */ private void initConversationContext(final ConversationContext context) { if (webBeansContext.getService(ConversationService.class) == null) { return; } if (context == null) { if (conversationContext.get() == null) { final ConversationContext newContext = new ConversationContext(); newContext.setActive(true); conversationContext.set(newContext); } else { conversationContext.get().setActive(true); } } else { context.setActive(true); conversationContext.set(context); } }
private void startConversationContext() { ConversationManager conversationManager = webBeansContext.getConversationManager(); ConversationContext ctx = conversationManager.getConversationContext(getCurrentSessionContext()); ctx.setActive(true); conversationContext.set(ctx); if (ctx.getConversation().isTransient()) { webBeansContext.getBeanManagerImpl().fireContextLifecyleEvent( conversationManager.getLifecycleEventPayload(ctx), InitializedLiteral.INSTANCE_CONVERSATION_SCOPED); } }