Examples of PushContext


Examples of org.icepush.PushContext

   */
  public String firePushEventAction(HttpServletRequest request, HttpServletResponse response) {
    String dataSourceId = null;
    try {
      dataSourceId = request.getParameter("dataSourceId");
      PushContext pushContext = PushContext.getInstance(request.getSession().getServletContext());
      pushContext.push(dataSourceId);
      response.setStatus(HttpServletResponse.SC_OK);
    } catch (Exception e) {
      log.error("error while firing Push Event for dataSourceId: " + dataSourceId, e);
      response.setStatus(HttpServletResponse.SC_CONFLICT);
    }
View Full Code Here

Examples of org.richfaces.application.push.PushContext

                Session session = null;

                if (pushSessionId != null) {
                    ensureServletContextAvailable(request);
                    PushContext pushContext = (PushContext) servletContext.getAttribute(PushContext.INSTANCE_KEY_NAME);
                    session = pushContext.getSessionManager().getPushSession(pushSessionId);
                }

                if (session == null) {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug(MessageFormat.format("Session {0} was not found", pushSessionId));
View Full Code Here

Examples of org.richfaces.application.push.PushContext

                Thread.sleep(50);
            }
        }

        private Session getCurrentSession() {
            PushContext pushContext = pushContextFactory.getPushContext();
            String pushSessionId = request.getParameter(PushHandlerFilter.PUSH_SESSION_ID_PARAM);
            Session session = pushContext.getSessionManager().getPushSession(pushSessionId);
            return session;
        }
View Full Code Here

Examples of org.richfaces.application.push.PushContext

    @Override
    public PushContext getPushContext() {
        if (PUSH_CONTEXT_HOLDER.get() == null) {
            synchronized (PUSH_CONTEXT_HOLDER) {
                if (PUSH_CONTEXT_HOLDER.get() == null) {
                    PushContext pushContext = createInstance();
                    PUSH_CONTEXT_HOLDER.set(pushContext);
                }
            }
        }
        return PUSH_CONTEXT_HOLDER.get();
View Full Code Here

Examples of org.richfaces.application.push.PushContext

        return pushResource.getRequestPath();
    }

    protected String getPushHandlerUrl(FacesContext context) {
        PushContext pushContext = ServiceTracker.getService(PushContextFactory.class).getPushContext();

        return pushContext.getPushHandlerUrl();
    }
View Full Code Here

Examples of org.richfaces.application.push.PushContext

        // resource plugin stub
        if (pushContextFactory == null) {
            return;
        }

        PushContext pushContext = pushContextFactory.getPushContext();

        String forgetPushSessionId = externalContext.getRequestParameterMap().get(FORGET_PUSH_SESSION_ID_PARAM);
        if (forgetPushSessionId != null) {
            Session oldSession = pushContext.getSessionManager().getPushSession(forgetPushSessionId);
            if (oldSession != null) {
                oldSession.invalidate();
            }
        }

        Session session = pushContext.getSessionFactory().createSession(UUID.randomUUID().toString());

        String[] topicNames = externalContext.getRequestParameterValuesMap().get(PUSH_TOPIC_PARAM);

        if (topicNames == null) {
            throw new IllegalArgumentException(PUSH_TOPIC_PARAM + " request parameter must be present");
View Full Code Here

Examples of org.richfaces.application.push.PushContext

        return pushResource.getRequestPath();
    }

    protected String getPushHandlerUrl(FacesContext context) {
        PushContext pushContext = ServiceTracker.getService(PushContextFactory.class).getPushContext();

        return pushContext.getPushHandlerUrl();
    }
View Full Code Here

Examples of org.richfaces.application.push.PushContext

        // resource plugin stub
        if (pushContextFactory == null) {
            return;
        }

        PushContext pushContext = pushContextFactory.getPushContext();

        String forgetPushSessionId = externalContext.getRequestParameterMap().get(FORGET_PUSH_SESSION_ID_PARAM);
        if (forgetPushSessionId != null) {
            Session oldSession = pushContext.getSessionManager().getPushSession(forgetPushSessionId);
            if (oldSession != null) {
                oldSession.invalidate();
            }
        }

        Session session = pushContext.getSessionFactory().createSession(UUID.randomUUID().toString());

        String[] topicNames = externalContext.getRequestParameterValuesMap().get(PUSH_TOPIC_PARAM);

        if (topicNames == null) {
            throw new IllegalArgumentException(PUSH_TOPIC_PARAM + " request parameter must be present");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.