package org.gluu.jsf2.service;

import java.io.Serializable;

import javax.enterprise.context.Conversation;
import javax.enterprise.context.ConversationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;

@Named
@ConversationScoped
public class ConversationService implements Serializable {

	private static final long serialVersionUID = -7432197667275722872L;

	@Inject
	private Conversation conversation;

	public void initConversation() {
		if (!FacesContext.getCurrentInstance().isPostback() && conversation.isTransient()) {
			conversation.begin();
		}
	}

	public void endConversation() {
		if (!conversation.isTransient()) {
			conversation.end();
		}
	}

}
@@ -420,16 +420,93 @@
 22872L;%0D
+%0A%09%0D%0A%09private static final long CONVERSATION_TIMEOUT = 30 * 60 * 60 * 1000L; %0D
 %0A%0D%0A%09@Inj
@@ -694,24 +694,75 @@
 n.begin();%0D%0A
+%09%09%09conversation.setTimeout(CONVERSATION_TIMEOUT);%0D%0A
 %09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09

Set default conversation time to 30 minutes