Package org.richfaces.application.push

Examples of org.richfaces.application.push.TopicsContext.publish()


        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


    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

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

    public static class Commons {
        public static final String TOPIC = "testingTopic";
View Full Code Here

    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

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

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.