protected void associateRequestWithNewConversation() { ManagedConversation conversation = new ConversationImpl(manager); lock(conversation); setRequestAttribute(getRequest(), CURRENT_CONVERSATION_ATTRIBUTE_NAME, conversation); // Set a temporary bean store, this will be attached at the end of the request if needed NamingScheme namingScheme = new ConversationNamingScheme(getNamingSchemePrefix(), "transient", beanIdentifierIndex); setBeanStore(createRequestBeanStore(namingScheme, getRequest())); setRequestAttribute(getRequest(), ConversationNamingScheme.PARAMETER_NAME, namingScheme); }
protected void associateRequestWithNewConversation() { ManagedConversation conversation = new ConversationImpl(manager); lock(conversation); setRequestAttribute(getRequest(), CURRENT_CONVERSATION_ATTRIBUTE_NAME, conversation); // Set a temporary bean store, this will be attached at the end of the request if needed NamingScheme namingScheme = new ConversationNamingScheme(getNamingSchemePrefix(), "transient", beanIdentifierIndex); setBeanStore(createRequestBeanStore(namingScheme, getRequest())); setRequestAttribute(getRequest(), ConversationNamingScheme.PARAMETER_NAME, namingScheme); }
protected void associateRequestWithNewConversation() { ManagedConversation conversation = new ConversationImpl(manager); lock(conversation); setRequestAttribute(getRequest(), CURRENT_CONVERSATION_ATTRIBUTE_NAME, conversation); // Set a temporary bean store, this will be attached at the end of the request if needed NamingScheme namingScheme = new ConversationNamingScheme(getNamingSchemePrefix(), "transient", beanIdentifierIndex); setBeanStore(createRequestBeanStore(namingScheme, getRequest())); setRequestAttribute(getRequest(), ConversationNamingScheme.PARAMETER_NAME, namingScheme); }
protected void associateRequestWithNewConversation() { ManagedConversation conversation = new ConversationImpl(manager); lock(conversation); setRequestAttribute(getRequest(), CURRENT_CONVERSATION_ATTRIBUTE_NAME, conversation); // Set a temporary bean store, this will be attached at the end of the request if needed NamingScheme namingScheme = new ConversationNamingScheme(getNamingSchemePrefix(), "transient", beanIdentifierIndex); setBeanStore(createRequestBeanStore(namingScheme, getRequest())); setRequestAttribute(getRequest(), ConversationNamingScheme.PARAMETER_NAME, namingScheme); }
protected void initialize(String cid) { // Attach the conversation // WELD-1315 Don't try to restore the long-running conversation if cid param is empty if (cid != null && !cid.isEmpty()) { ManagedConversation conversation = getConversation(cid); if (conversation != null && !isExpired(conversation)) { boolean lock = lock(conversation); if (lock) { // WELD-1690 Don't associate a conversation which was ended (race condition) if (conversation.isTransient()) { associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } associateRequest(conversation); } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.conversationLockTimedout(cid); } } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } } else { associateRequestWithNewConversation(); } }
protected void associateRequestWithNewConversation() { ManagedConversation conversation = new ConversationImpl(manager); lock(conversation); setRequestAttribute(getRequest(), CURRENT_CONVERSATION_ATTRIBUTE_NAME, conversation); // Set a temporary bean store, this will be attached at the end of the request if needed NamingScheme namingScheme = new ConversationNamingScheme(getNamingSchemePrefix(), "transient", beanIdentifierIndex); setBeanStore(createRequestBeanStore(namingScheme, getRequest())); setRequestAttribute(getRequest(), ConversationNamingScheme.PARAMETER_NAME, namingScheme); }
protected void initialize(String cid) { // Attach the conversation // WELD-1315 Don't try to restore the long-running conversation if cid param is empty if (cid != null && !cid.isEmpty()) { ManagedConversation conversation = getConversation(cid); if (conversation != null && !isExpired(conversation)) { boolean lock = lock(conversation); if (lock) { // WELD-1690 Don't associate a conversation which was ended (race condition) if (conversation.isTransient()) { associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } associateRequest(conversation); } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.conversationLockTimedout(cid); } } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } } else { associateRequestWithNewConversation(); } }
protected void initialize(String cid) { // Attach the conversation // WELD-1315 Don't try to restore the long-running conversation if cid param is empty if (cid != null && !cid.isEmpty()) { ManagedConversation conversation = getConversation(cid); if (conversation != null && !isExpired(conversation)) { boolean lock = lock(conversation); if (lock) { // WELD-1690 Don't associate a conversation which was ended (race condition) if (conversation.isTransient()) { associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } associateRequest(conversation); } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.conversationLockTimedout(cid); } } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } } else { associateRequestWithNewConversation(); } }
protected void initialize(String cid) { // Attach the conversation // WELD-1315 Don't try to restore the long-running conversation if cid param is empty if (cid != null && !cid.isEmpty()) { ManagedConversation conversation = getConversation(cid); if (conversation != null && !isExpired(conversation)) { boolean lock = lock(conversation); if (lock) { // WELD-1690 Don't associate a conversation which was ended (race condition) if (conversation.isTransient()) { associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } associateRequest(conversation); } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.conversationLockTimedout(cid); } } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } } else { associateRequestWithNewConversation(); } }
protected void initialize(String cid) { // Attach the conversation // WELD-1315 Don't try to restore the long-running conversation if cid param is empty if (cid != null && !cid.isEmpty()) { ManagedConversation conversation = getConversation(cid); if (conversation != null && !isExpired(conversation)) { boolean lock = lock(conversation); if (lock) { // WELD-1690 Don't associate a conversation which was ended (race condition) if (conversation.isTransient()) { associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } associateRequest(conversation); } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.conversationLockTimedout(cid); } } else { // CDI 6.7.4 we must activate a new transient conversation before we throw the exception associateRequestWithNewConversation(); throw ConversationLogger.LOG.noConversationFoundToRestore(cid); } } else { associateRequestWithNewConversation(); } }