stateRegistry = (ConversationRegistry)container.getComponentInstanceOfType(ConversationRegistry.class);
HttpServletRequest httpRequest = (HttpServletRequest)request;
ConversationState state = ConversationState.getCurrent();
SessionProvider provider = null;
// NOTE not create new HTTP session, if session is not created yet
// this means some settings is incorrect, see web.xml for filter
// org.exoplatform.services.security.web.SetCurrentIdentityFilter
HttpSession httpSession = httpRequest.getSession(false);
if (state == null)
{
if (log.isDebugEnabled())
log.debug("Current conversation state is not set");
if (httpSession != null)
{
StateKey stateKey = new HttpSessionStateKey(httpSession);
// initialize thread local SessionProvider
state = stateRegistry.getState(stateKey);
if (state != null)
provider = new SessionProvider(state);
else if (log.isDebugEnabled())
log.debug("WARN: Conversation State is null, id " + httpSession.getId());
}
}
else
{
provider = new SessionProvider(state);
}
if (provider == null)
{
if (log.isDebugEnabled())