Conversation conversation = conversationManager.getConversationBeanReference(); if (conversation != null && !conversation.isTransient())
public boolean isPassivatingScope() { final CdiEjbBean<?> bean = get(CdiEjbBean.class); if (bean == null) { return true; } if (ConversationScoped.class == bean.getScope()) { try { return !bean.getWebBeansContext().getConversationManager().getConversationBeanReference().isTransient(); } catch (final RuntimeException re) { // conversation not found for instance so act as @RequestScoped return false; } } return true; }
public boolean isPassivatingScope() { final CdiEjbBean<?> bean = get(CdiEjbBean.class); if (bean == null) { return true; } if (ConversationScoped.class == bean.getScope()) { try { return !bean.getWebBeansContext().getConversationManager().getConversationBeanReference().isTransient(); } catch (final RuntimeException re) { // conversation not found for instance so act as @RequestScoped return false; } } return true; }
/** * {@inheritDoc} */ @Override public String getActionURL(FacesContext context, String viewId) { if(!isOwbApplication()) { return delegate.getActionURL(context, viewId); } String url = delegate.getActionURL(context, viewId); ConversationManager conversationManager = WebBeansContext.getInstance().getConversationManager(); Conversation conversation = conversationManager.getConversationBeanReference(); if (conversation != null && !conversation.isTransient()) { url = JSFUtil.getRedirectViewIdWithCid(url, conversation.getId()); } return url; }
/** * {@inheritDoc} */ @Override public String getActionURL(FacesContext context, String viewId) { if(!isOwbApplication()) { return delegate.getActionURL(context, viewId); } String url = delegate.getActionURL(context, viewId); ConversationManager conversationManager = WebBeansContext.getInstance().getConversationManager(); Conversation conversation = conversationManager.getConversationBeanReference(); if (conversation != null && !conversation.isTransient()) { url = JSFUtil.getRedirectViewIdWithCid(url, conversation.getId()); } return url; }
private void cleanupConversation() { if (webBeansContext.getService(ConversationService.class) == null) { return; } final ConversationContext conversationContext = getConversationContext(); if (conversationContext == null) { return; } final ConversationManager conversationManager = webBeansContext.getConversationManager(); final Conversation conversation = conversationManager.getConversationBeanReference(); if (conversation == null) { return; } if (conversation.isTransient()) { webBeansContext.getContextsService().endContext(ConversationScoped.class, null); } else { final ConversationImpl conversationImpl = (ConversationImpl) conversation; conversationImpl.updateTimeOut(); conversationImpl.setInUsed(false); } }