@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override protected Conversation newInstance(InjectionPoint ip, CreationalContext<Conversation> creationalContext) { for (ConversationContext conversationContext : getBeanManager().instance().select(ConversationContext.class)) { if (conversationContext.isActive()) { return conversationContext.getCurrentConversation(); } } /* * Can't get a "real" Conversation, but we need to return something, so * return this dummy Conversation which will simply throw a * ContextNotActiveException for every method call as the spec requires. */ return new ConversationImpl(beanManager); }
@Override public void sendRedirect(String path) throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context != null) { // this is a JSF request ConversationContext conversationContext = instance(contextId).select(HttpConversationContext.class).get(); if (conversationContext.isActive()) { Conversation conversation = conversationContext.getCurrentConversation(); if (!conversation.isTransient()) { path = new FacesUrlTransformer(path, context) .toRedirectViewId() .toActionUrl() .appendConversationIdIfNecessary(conversationContext.getParameterName(), conversation.getId()) .encode(); } } } super.sendRedirect(path); } };
/** * Allow the delegate to produce the action URL. If the conversation is * long-running, append the conversation id request parameter to the query * string part of the URL, but only if the request parameter is not already * present. * <p/> * This covers form actions Ajax calls, and redirect URLs (which we want) and * link hrefs (which we don't) * * @see {@link ViewHandler#getActionURL(FacesContext, String)} */ @Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx!= null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
@Override public void sendRedirect(String path) throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context != null) { // this is a JSF request ConversationContext conversationContext = instance(contextId).select(HttpConversationContext.class).get(); if (conversationContext.isActive()) { Conversation conversation = conversationContext.getCurrentConversation(); if (!conversation.isTransient()) { path = new FacesUrlTransformer(path, context) .toRedirectViewId() .toActionUrl() .appendConversationIdIfNecessary(conversationContext.getParameterName(), conversation.getId()) .encode(); } } } super.sendRedirect(path); } };
/** * Allow the delegate to produce the action URL. If the conversation is * long-running, append the conversation id request parameter to the query * string part of the URL, but only if the request parameter is not already * present. * <p/> * This covers form actions Ajax calls, and redirect URLs (which we want) and * link hrefs (which we don't) * * @see {@link ViewHandler#getActionURL(FacesContext, String)} */ @Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx!= null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
@Override public void sendRedirect(String path) throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context != null) { // this is a JSF request ConversationContext conversationContext = instance(contextId).select(HttpConversationContext.class).get(); if (conversationContext.isActive()) { Conversation conversation = conversationContext.getCurrentConversation(); if (!conversation.isTransient()) { path = new FacesUrlTransformer(path, context) .toRedirectViewId() .toActionUrl() .appendConversationIdIfNecessary(conversationContext.getParameterName(), conversation.getId()) .encode(); } } } super.sendRedirect(path); } };
/** * Allow the delegate to produce the action URL. If the conversation is * long-running, append the conversation id request parameter to the query * string part of the URL, but only if the request parameter is not already * present. * <p/> * This covers form actions Ajax calls, and redirect URLs (which we want) and * link hrefs (which we don't) * * @see {@link ViewHandler#getActionURL(FacesContext, String)} */ @Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx!= null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
@Override public void sendRedirect(String path) throws IOException { FacesContext context = FacesContext.getCurrentInstance(); if (context != null) { // this is a JSF request ConversationContext conversationContext = instance(contextId).select(HttpConversationContext.class).get(); if (conversationContext.isActive()) { Conversation conversation = conversationContext.getCurrentConversation(); if (!conversation.isTransient()) { path = new FacesUrlTransformer(path, context) .toRedirectViewId() .toActionUrl() .appendConversationIdIfNecessary(conversationContext.getParameterName(), conversation.getId()) .encode(); } } } super.sendRedirect(path); } };
/** * Allow the delegate to produce the action URL. If the conversation is * long-running, append the conversation id request parameter to the query * string part of the URL, but only if the request parameter is not already * present. * <p/> * This covers form actions Ajax calls, and redirect URLs (which we want) and * link hrefs (which we don't) * * @see {@link ViewHandler#getActionURL(FacesContext, String)} */ @Override public String getActionURL(FacesContext facesContext, String viewId) { if (contextId == null) { if (facesContext.getAttributes().containsKey(Container.CONTEXT_ID_KEY)) { contextId = (String) facesContext.getAttributes().get(Container.CONTEXT_ID_KEY); } else { contextId = RegistrySingletonProvider.STATIC_INSTANCE; } } String actionUrl = super.getActionURL(facesContext, viewId); final ConversationContext ctx = getConversationContext(contextId); if (ctx != null && ctx.isActive() && !getSource().equals(Source.BOOKMARKABLE) && !ctx.getCurrentConversation().isTransient()) { return new FacesUrlTransformer(actionUrl, facesContext) .appendConversationIdIfNecessary(getConversationContext(contextId).getParameterName(), ctx.getCurrentConversation().getId()) .getUrl(); } else { return actionUrl; } }
boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId());
boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId());
boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId());
boolean isTransient = conversationContext.getCurrentConversation().isTransient(); if (ConversationLogger.LOG.isTraceEnabled()) { if (isTransient) { ConversationLogger.LOG.cleaningUpTransientConversation(); } else { ConversationLogger.LOG.cleaningUpConversation(conversationContext.getCurrentConversation().getId());