Package org.richfaces.application.push

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


                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

    @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

        return pushResource.getRequestPath();
    }

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

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

        // 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

        return pushResource.getRequestPath();
    }

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

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

        // 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

Related Classes of org.richfaces.application.push.PushContext

Copyright © 2018 www.massapicom. 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.