Refine search
private void beginConversation() { if (conversationInstance.get().isTransient()) { conversationInstance.get().begin(); } }
public boolean isDefaultConversationHasNullId() { return conversation.isTransient() && conversation.getId() == null; }
public void completeProcessInstanceForm() throws IOException { // start the process instance if (processDefinitionId!=null) { businessProcess.startProcessById(processDefinitionId); processDefinitionId = null; } else { businessProcess.startProcessByKey(processDefinitionKey); processDefinitionKey = null; } // End the conversation conversationInstance.get().end(); // and redirect FacesContext.getCurrentInstance().getExternalContext().redirect(url); }
public void beginConversationAndSetTimeout() { conversation.begin(); conversation.setTimeout(timeout); }
@Inject Conversation conversation; @PostConstruct public void init() { if(conversation.isTransient()) { conversation.end(); } conversation.setTimeout(120000); conversation.start(); }
@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); } };
/** * Starts a new conversation */ protected void startConversation() { if (conversation.isTransient()) { conversation.setTimeout( ((HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest()) .getSession().getMaxInactiveInterval() * 1000); conversation.begin(); logger.finest("......start new conversation, id=" + conversation.getId()); } }
public void beforePhase(PhaseEvent event) { BeanManager beanManager = CDI.current().getBeanManager(); if (event.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) { try { beanManager.getContext(ConversationScoped.class); activeBeforeApplyRequestValues = true; } catch (ContextNotActiveException e) { activeBeforeApplyRequestValues = false; } } if (event.getPhaseId().equals(PhaseId.RENDER_RESPONSE)) { Conversation conversation = CDI.current().select(Conversation.class).get(); HttpServletResponse response = (HttpServletResponse) event.getFacesContext().getExternalContext().getResponse(); response.addHeader(AbstractConversationTest.CID_HEADER_NAME, conversation.getId() == null ? " null" : conversation.getId()); response.addHeader(AbstractConversationTest.LONG_RUNNING_HEADER_NAME, String.valueOf(!conversation.isTransient())); response.addHeader(Cloud.RAINED_HEADER_NAME, new Boolean(BeanLookupUtils.getContextualReference(beanManager, Cloud.class) .isRained()).toString()); response.addHeader(ACTIVE_BEFORE_APPLY_REQUEST_VALUES_HEADER_NAME, new Boolean(activeBeforeApplyRequestValues).toString()); } }
public void beforePhase(PhaseEvent event) { JSR299Configuration configuration = ConfigurationFactory.get(JSR299Configuration.class); if (event.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES)) { try { configuration.getManagers().getManager().getContext(ConversationScoped.class); activeBeforeApplyRequestValues = true; } catch (ContextNotActiveException e) { activeBeforeApplyRequestValues = false; } } if (event.getPhaseId().equals(PhaseId.RENDER_RESPONSE)) { BeanManager beanManager = configuration.getManagers().getManager(); Conversation conversation = OldSPIBridge.getInstanceByType(beanManager, Conversation.class); HttpServletResponse response = (HttpServletResponse) event.getFacesContext().getExternalContext().getResponse(); response.addHeader(AbstractConversationTest.CID_HEADER_NAME, conversation.getId() == null ? " null" : conversation.getId()); response.addHeader(AbstractConversationTest.LONG_RUNNING_HEADER_NAME, String.valueOf(!conversation.isTransient())); response.addHeader(Cloud.RAINED_HEADER_NAME, new Boolean(OldSPIBridge.getInstanceByType(beanManager, Cloud.class).isRained()).toString()); response.addHeader(ACTIVE_BEFORE_APPLY_REQUEST_VALUES_HEADER_NAME, new Boolean(activeBeforeApplyRequestValues).toString()); } }
protected void autoBeginIfNecessary(Page page, IRequestHandler handler) { if (conversation == null || !conversation.isTransient() || page == null || !hasConversationalComponent(page) || !propagation.propagatesVia(handler, page)) { return; } // auto activate conversation conversation.begin(); autoConversation.setAutomatic(true); logger.debug("Auto-began conversation '{}' for page '{}'", conversation.getId(), page); }
public HttpResponse loginForm(Parameters params, Conversation conversation) { if (conversation.isTransient()) conversation.begin(); return templateEngine.render("guestbook/login", "url", params.get("url")); }
@Begin(timeout = 1000) public void beginConversation() { if (!conversation.isTransient()) { conversationLongRunningDuringInvocation = true; } }
/** * Closes the current conversation and reset the data item. A conversation is * automatically started by the methods load() and onLoad(). You can call the * close() method in a actionListener on any JSF navigation action. */ public void close() { if (!conversation.isTransient()) { logger.finest("......stopping conversation, id=" + conversation.getId()); conversation.end(); } }
if (conversation != null && !request.getConversation().isTransient()) { String token = conversation.getId() + "$" + hmacEncoder.encodeToHex(conversation.getId() + "$" + conversation.getTimeout()) + "$" + conversation.getTimeout(); tres.getContext().put("conversationToken", token);
Connection<Conversation> conversations = facebookClient.fetchConnection("me/conversations", Conversation.class); for(List<Conversation> conversationPage : conversations) { for(Conversation conversation : conversationPage) { String id = conversation.getId(); Connection<Message> messages = facebookClient.fetchConnection(id + "/messages", Message.class, Parameter.with("fields", "message,created_time,from,id")); } }
private void beginConversation(final InvocationContext ctx) throws Exception { Begin beginAnnotation = AnnotationInspector.getAnnotation(ctx.getMethod(), Begin.class, beanManager); String cid = beginAnnotation.id(); if ((cid != null) && !"".equals(cid)) { conversation.begin(cid); } else { conversation.begin(); } long timeout = beginAnnotation.timeout(); if (timeout != -1) { conversation.setTimeout(timeout); } log.debug("Began conversation: (#0) before method: (#1.#2(...))", new Object[]{conversation.getId(), ctx.getMethod().getDeclaringClass().getName(), ctx.getMethod().getName()}); }
public HttpResponse page3(Conversation conversation) { if (!conversation.isTransient()) conversation.end(); return templateEngine.render("conversationState/page3"); }
public String getBeginConversation() { conversation.begin(); return "long-running conversation begun"; }