Examples of Notify


Examples of org.oasis_open.docs.wsn.b_2.Notify

    public void notify(String topic, Object msg) {
        notify(null, topic, msg);
    }

    public void notify(Referencable publisher, String topic, Object msg) {
        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);
        broker.notify(notify);
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

    public void testPull() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        List<NotificationMessageHolderType> msgs = pullPoint.getMessages(0);
        assertNotNull(msgs);
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

  @Override
  protected synchronized void store(NotificationMessageHolderType messageHolder) {
    try {
      initSession();
            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 e) {
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

        if (msg == null) {
          break;
        }
        TextMessage txtMsg = (TextMessage) msg;
        StringReader reader = new StringReader(txtMsg.getText());
        Notify notify = (Notify) jaxbContext.createUnmarshaller().unmarshal(reader);
        messages.addAll(notify.getNotificationMessage());
      }
      return messages;
    } catch (JMSException e) {
      log.info("Error retrieving messages", e);
      if (session != null) {
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

    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 e) {
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

    setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
    setResolver(resolveWSA(getEndpoint()));
  }

  public void notify(String topic, Object msg) throws JBIException {
    Notify notify = new Notify();
    NotificationMessageHolderType holder = new NotificationMessageHolderType();
    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);
    send(notify);
  }
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.Notify

            } 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);
    }
View Full Code Here

Examples of org.red5.server.net.rtmp.event.Notify

 
  protected void onCommand(RTMPConnection conn, Channel channel, Header source, ICommand command) {
    if (!(command instanceof Notify)) {
      return;
    }
    Notify invoke = (Notify)command;
    if (invoke.getType() == IEvent.Type.STREAM_DATA) {
      return;
    }
   
    String method = invoke.getCall().getServiceMethodName();
    if ("stopStream".equals(method)) {
      stopStream();
    } else if ("sendRemoteCursorEvent".equals(method)) {
      sendRemoteCursorEvent(invoke.getCall().getArguments()[0]);
    } else if ("screenSharerAction".equals(method)) {
      Object[] args = invoke.getCall().getArguments();
      if (args != null && args.length > 0) {
        @SuppressWarnings("unchecked")
        Map<String, Object> params = (Map<String, Object>)args[0];
        if (bool(params.get("stopPublishing"))) {
          stopPublishing();
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.