Package org.richfaces.application.push

Examples of org.richfaces.application.push.TopicsContext


         *
         * References to {@link TopicsContext} and {@link TopicKeyResolver} (needed for {@link TopicKey} resolution) are done
         * through {@link BeanManager}.
         */
        public void notify(Object payload) {
            TopicsContext topicsContext = getBeanReference(TopicsContext.class);
            TopicKeyResolver topicKeyResolver = getBeanReference(TopicKeyResolver.class);
            TopicKey topicKey = topicKeyResolver.resolveTopicKey(pushAnnotation);
            try {
                topicsContext.publish(topicKey, payload);
            } catch (MessageException e) {
                throw new PushCDIMessageException("Message wasn't successfully deliver", e);
            }
        }
View Full Code Here


        return new Date();
    }

    public void push() throws MessageException {
        TopicKey topicKey = new TopicKey("sampleAddress");
        TopicsContext topicsContext = TopicsContext.lookup();

        topicsContext.publish(topicKey, new Date().toString());

        System.out.println("push event");
    }
View Full Code Here

            Session session = pushContext.getSessionManager().getPushSession(pushSessionId);
            return session;
        }

        private void sendMessage(String message) throws MessageException {
            TopicsContext topicsContext = TopicsContext.lookup();
            TopicKey topicKey = new TopicKey(Commons.TOPIC);
            topicsContext.getOrCreateTopic(topicKey);
            topicsContext.publish(topicKey, message);
        }
View Full Code Here

    public void sendMessage() throws MessageException {
        sendMessage(++count);
    }

    private void sendMessage(Object message) throws MessageException {
        TopicsContext topicsContext = TopicsContext.lookup();
        TopicKey topicKey = new TopicKey(AbstractPushTestWithoutWarp.TOPIC);
        topicsContext.getOrCreateTopic(topicKey);
        topicsContext.publish(topicKey, message);
    }
View Full Code Here

     * @see org.richfaces.demo.push.MessageProducer#sendMessage()
     */
    public void sendMessage() throws Exception {
        try {
            TopicKey topicKey = new TopicKey(PUSH_TOPICS_CONTEXT_TOPIC);
            TopicsContext topicsContext = TopicsContext.lookup();
            topicsContext.publish(topicKey, "message");
        } catch (Exception e) {
            log.info("Sending push message using TopicContext failed (" + e.getMessage()
                    + ") - operation will be repeated in few seconds");
            if (log.isDebugEnabled()) {
                log.debug(e);
View Full Code Here

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
      
        TopicsContext topicsContext = TopicsContext.lookup();
       
        Topic topic = topicsContext.getOrCreateTopic(new TopicKey("inmobles"));
       
        topic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
       
        topic.addTopicListener(new SessionTopicListener() {
           
View Full Code Here

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
      
        TopicsContext topicsContext = TopicsContext.lookup();
       
        Topic topic = topicsContext.getOrCreateTopic(new TopicKey("inmobles"));
       
        topic.setMessageDataSerializer(DefaultMessageDataSerializer.instance());
       
        topic.addTopicListener(new SessionTopicListener() {
           
View Full Code Here

TOP

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

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.