Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_XmlBlasterAccess.subscribe()


         assertTrue("", xmlBlasterAccess.getConnectQos() == null);
         assertTrue("", xmlBlasterAccess.getId() != null);
         assertTrue("", xmlBlasterAccess.getSessionName() == null);

         try {
            xmlBlasterAccess.subscribe((SubscribeKey)null, null);
         }
         catch (XmlBlasterException e) {
            if (e.isUser())
               log.info("Exception is OK if not connected: " + e.getErrorCode());
            else
View Full Code Here


            else
               fail("testCreation failed: " + e.getMessage());
         }

         try {
            xmlBlasterAccess.subscribe((String)null, null);
         }
         catch (XmlBlasterException e) {
            if (e.isUser())
               log.info("Exception is OK if not connected: " + e.getErrorCode());
            else
View Full Code Here

            else
               fail("testCreation failed: " + e.getMessage());
         }

         try {
            xmlBlasterAccess.subscribe((SubscribeKey)null, null, null);
         }
         catch (XmlBlasterException e) {
            if (e.isUser())
               log.info("Exception is OK if not connected: " + e.getErrorCode());
            else
View Full Code Here

         // Subscribe to messages with XPATH using some helper classes
         log.info("Subscribing #1 for anonymous callback class using XPath syntax ...");
         SubscribeKey key = new SubscribeKey(glob, "//DispatchTest", "XPATH");
         SubscribeQos qos = new SubscribeQos(glob);
         blasterConnection.subscribe(key, qos, new I_Callback() {
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info("Receiving message with specialized update() #1 ...");
                  numReceived1++;
                  System.out.println(updateKey.toXml());
                  System.out.println((new String(content)).toString());
View Full Code Here

            });


         log.info("Subscribing #2 for anonymous callback class using XPath syntax ...");
         key = new SubscribeKey(glob, "A message id");
         blasterConnection.subscribe(key, qos, new I_Callback() {
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info("Receiving message with specialized update() #2 ...");
                  numReceived2++;
                  System.out.println(updateKey.toXml());
                  System.out.println((new String(content)).toString());
View Full Code Here

            qos.getSessionCbQueueProperty().setMaxEntriesCache(10L);
            I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
            conn.connect(qos, this);
            SubscribeKey subKey = new SubscribeKey(global, topicName);
            SubscribeQos subQos = new SubscribeQos(global);
            conn.subscribe(subKey, subQos);
            // conn.leaveServer(null);
            DisconnectQos disconnectQos = new DisconnectQos(global);
            disconnectQos.setLeaveServer(true);
            conn.disconnect(disconnectQos);
         }
View Full Code Here

         ConnectQos qos = new ConnectQos(secondGlobal, "tester/1", "secret");
         I_XmlBlasterAccess conn2 = secondGlobal.getXmlBlasterAccess();
         conn2.connect(qos, msgInterceptor);
         SubscribeKey subKey = new SubscribeKey(secondGlobal, "__sys__Event");
         SubscribeQos subQos = new SubscribeQos(secondGlobal);
         conn2.subscribe(subKey, subQos);
         msgInterceptor.clear();

         {
            // publish now
            Global global = new Global(args);
View Full Code Here

            qos.getSessionCbQueueProperty().setMaxEntriesCache(10L);
            I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
            conn.connect(qos, this);
            SubscribeKey subKey = new SubscribeKey(global, topicName);
            SubscribeQos subQos = new SubscribeQos(global);
            conn.subscribe(subKey, subQos);
            // conn.leaveServer(null);
            DisconnectQos disconnectQos = new DisconnectQos(global);
            disconnectQos.setLeaveServer(true);
            conn.disconnect(disconnectQos);
         }
View Full Code Here

         ConnectQos qos = new ConnectQos(secondGlobal, "tester/2", "secret");
         I_XmlBlasterAccess conn2 = secondGlobal.getXmlBlasterAccess();
         conn2.connect(qos, msgInterceptor);
         SubscribeKey subKey = new SubscribeKey(secondGlobal, "__sys__Event");
         SubscribeQos subQos = new SubscribeQos(secondGlobal);
         conn2.subscribe(subKey, subQos);
         msgInterceptor.clear();

         {
            // publish now
            Global global = new Global(args);
View Full Code Here

         xmlKey = "<?xml version='1.0' encoding='ISO-8859-1' ?>\n" +
                  "<key oid='" + publishOid + "' queryType='EXACT'>\n" +
                  "</key>";
         stop.restart();
         try {
            String subId = blasterConnection.subscribe(xmlKey, "<qos></qos>").getSubscriptionId();
            log.fine("Subscribed to '" + subId + "' ..." + stop.nice());
         } catch(XmlBlasterException e) {
            log.severe("Subscribe failed, XmlBlasterException: " + e.getMessage());
         }
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.