/** * Create an instance of {@link Notify } * */ public Notify createNotify() { return new Notify(); }
/** * Create an instance of {@link Notify } * */ public Notify createNotify() { return new Notify(); }
(function() { var notify = new Notify({ container: document.getElementById('alerts'), template: `<div class="alert alert-{{type}}" role="alert"><div class="text-center">{{message}}</div></div>` }); notify.danger('Some error message'); }());
/** * Create an instance of {@link Notify } * */ public Notify createNotify() { return new Notify(); }
@RequestMapping(value = "/test-notification", method = RequestMethod.POST) public void testNotification(@RequestBody String recipientId) throws InterruptedException { this.template.convertAndSendToUser(recipientId,"/greetings", new Notify("ALERT: There is a new notification for you!")); }
@Override protected void store(NotificationMessageHolderType messageHolder) { try { initSession(); Notify notify = new Notify(); notify.getNotificationMessage().add(messageHolder); StringWriter writer = new StringWriter(); jaxbContext.createMarshaller().marshal(notify, writer); synchronized (producerSession) { Message message = producerSession.createTextMessage(writer.toString()); producer.send(message); } } catch (JMSException e) { LOGGER.log(Level.WARNING, "Error storing message", e); closeSession(); } catch (JAXBException e) { LOGGER.log(Level.WARNING, "Error storing message", e); } }
@Override public void notify(NotificationMessageHolderType messageHolder) { Session session = null; try { Topic topic = topicConverter.toActiveMQTopic(messageHolder.getTopic()); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(topic); Notify notify = new Notify(); notify.getNotificationMessage().add(messageHolder); StringWriter writer = new StringWriter(); jaxbContext.createMarshaller().marshal(notify, writer); Message message = session.createTextMessage(writer.toString()); producer.send(message); } catch (JMSException | JAXBException | InvalidTopicException e) { LOGGER.log(Level.WARNING, "Error dispatching message", e); } finally { if (session != null) { try { session.close(); } catch (JMSException e) { LOGGER.log(Level.FINE, "Error closing session", e); } } } }
public void notify(Referencable publisher, String topic, Object msg) { getBroker(); if (this.context != null) { try { DOMResult result = new DOMResult(); context.createMarshaller().marshal(msg, result); msg = result.getNode(); if (msg instanceof Document) { msg = ((Document)msg).getDocumentElement(); } } catch (JAXBException e) { //ignore, we'll try and let the runtime handle it as is } } Notify notify = new Notify(); NotificationMessageHolderType holder = new NotificationMessageHolderType(); if (publisher != null) { holder.setProducerReference(publisher.getEpr()); } if (topic != null) { TopicExpressionType topicExp = new TopicExpressionType(); topicExp.getContent().add(topic); holder.setTopic(topicExp); } holder.setMessage(new NotificationMessageHolderType.Message()); holder.getMessage().setAny(msg); notify.getNotificationMessage().add(holder); getBroker().notify(notify); }
NotificationMessageHolderType... notificationMessages) throws TranslationException { Notify notify = new Notify();
CompoundEvent... compoundEvents) throws TranslationException { Notify notify = new Notify();
String producerReference, Object payload) { Notify notify = new Notify(); NotificationMessageHolderType notificationMessage = new NotificationMessageHolderType();
Notify notify = new Notify(); NotificationMessageHolderType msg = new NotificationMessageHolderType();