Examples of MsgInterceptor


Examples of org.xmlBlaster.test.MsgInterceptor

         addressProp.setPingInterval(-1L); // switched off
         con.registerConnectionListener(this);

         connectQos.setAddress(addressProp);

         this.updateInterceptor = new MsgInterceptor(this.glob, log, null); // Collect received msgs

         con.connect(connectQos, this.updateInterceptor)// Login to xmlBlaster, register for updates
      }
      catch (XmlBlasterException e) {
          log.warning("setUp() - login failed: " + e.getMessage());
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

      try {
         Global senderGlobal = Util.getOtherServerPorts(glob, serverPort);
         this.senderConnection = senderGlobal.getXmlBlasterAccess();
         ConnectQos qos = new ConnectQos(senderGlobal, senderName, senderPasswd);

         this.updateInterceptor = new MsgInterceptor(senderGlobal, log, null);
         this.senderConnection.connect(qos, this.updateInterceptor);
      }
      catch (XmlBlasterException e) {
          log.warning("setUp() - login failed");
      }
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

         Util.delay( delay4Server );    // Wait some time

         Global globSender = Util.getOtherServerPorts(glob, serverPort);
         this.senderConnection = globSender.getXmlBlasterAccess(); // Find orb
         ConnectQos qos = new ConnectQos(globSender, senderName, senderPasswd);
         this.updateInterceptor = new MsgInterceptor(globSender, log, null);
         this.senderConnection.connect(qos, this.updateInterceptor);
      }
      catch (XmlBlasterException e) {
         log.warning("setUp() - login failed");
      }
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

   protected void setUp() throws Exception {
      super.setUp();
      log.info("Trying to connect to xmlBlaster with Java client lib " + global.getVersion());
      try {
         this.connGlobal = this.global.getClone(null);
         this.updateInterceptor = new MsgInterceptor(this.connGlobal, log, null);
         this.connGlobal.getXmlBlasterAccess().connect(new ConnectQos(this.connGlobal), this.updateInterceptor);
      }
      catch (XmlBlasterException ex) {
         ex.printStackTrace();
         fail("aborting since exception ex: " + ex.getMessage());
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

            disconnectQos.setLeaveServer(true);
            conn.disconnect(disconnectQos);
         }

         Global secondGlobal = new Global(args);
         MsgInterceptor msgInterceptor = new MsgInterceptor(secondGlobal, log, null);
         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);
            qos = new ConnectQos(global, "testPublisher/1", "secret");
            I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
            conn.connect(qos, this);
            PublishKey pubKey = new PublishKey(global, topicName);
            PublishQos pubQos = new PublishQos(global);
            for (int i=0; i < 5; i++) {
               String content = "This is test " + i;
               conn.publish(new MsgUnit(pubKey, content.getBytes(), pubQos));
            }
           
            int ret = msgInterceptor.waitOnUpdate(3000L, 1);
            assertEquals("We expected one message for the excess of the history queue", 1, ret);
            msgInterceptor.clear();
            for (int i=5; i < 8; i++) {
               String content = "This is test " + i;
               conn.publish(new MsgUnit(pubKey, content.getBytes(), pubQos));
            }
            ret = msgInterceptor.waitOnUpdate(3000L, 1);
            assertEquals("We expected one message", 1, ret);
            msgInterceptor.clear();
            conn.disconnect(new DisconnectQos(global));
         }

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

Examples of org.xmlBlaster.test.MsgInterceptor

            disconnectQos.setLeaveServer(true);
            conn.disconnect(disconnectQos);
         }

         Global secondGlobal = new Global(args);
         MsgInterceptor msgInterceptor = new MsgInterceptor(secondGlobal, log, null);
         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);
            qos = new ConnectQos(global, "testPublisher/1", "secret");
            I_XmlBlasterAccess conn = global.getXmlBlasterAccess();
            conn.connect(qos, this);
            PublishKey pubKey = new PublishKey(global, topicName);
            PublishQos pubQos = new PublishQos(global);
            for (int i=0; i < 5; i++) {
               String content = "This is test " + i;
               conn.publish(new MsgUnit(pubKey, content.getBytes(), pubQos));
            }
           
            int ret = msgInterceptor.waitOnUpdate(3000L, 1);
            assertEquals("We expected one message for the excess of the history queue", 1, ret);
            msgInterceptor.clear();
            for (int i=5; i < 8; i++) {
               String content = "This is test " + i;
               conn.publish(new MsgUnit(pubKey, content.getBytes(), pubQos));
            }
            ret = msgInterceptor.waitOnUpdate(3000L, 2);
            assertEquals("We expected two messages: one for the excess of the callback queue and the other for the excess of the history queue of the __sys__Event topic", 2, ret);
            msgInterceptor.clear();
            conn.disconnect(new DisconnectQos(global));
         }

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

Examples of org.xmlBlaster.test.MsgInterceptor

         addressProp.setPingInterval(1000L)// ping every second
         con.registerConnectionListener(this);

         connectQos.setAddress(addressProp);
        
         this.updateInterceptor = new MsgInterceptor(this.glob, log, null); // Collect received msgs

         // and do the login ...
         con.connect(connectQos, this.updateInterceptor); // Login to xmlBlaster
      }
      catch (XmlBlasterException e) {
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

    * Connect to xmlBlaster and login
    */
   protected void setUp() {
      this.glob = (this.glob == null) ? Global.instance() : this.glob;

      this.updateInterceptor = new MsgInterceptor(this.glob, log, null);
     
      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess(); // Find orb

         String passwd = "secret";
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

         ConnectQos connectQos = new ConnectQos(gg);
         SessionName sessionName = new SessionName(gg, loginName);
         connectQos.setSessionName(sessionName);
         client.con = gg.getXmlBlasterAccess();
         client.con.registerConnectionListener(this);
         client.updateInterceptor = new MsgInterceptor(gg, log, cb); // Collect received msgs
         client.con.connect(connectQos, client.updateInterceptor); // Login to xmlBlaster
         return client;
      }
      catch (XmlBlasterException e) {
         log.warning("doConnect() - login failed: " + e.getMessage());
View Full Code Here

Examples of org.xmlBlaster.test.MsgInterceptor

      if (file.exists())
         FileLocator.deleteDir(file);
      */
      try {
         this.connGlobal = this.global.getClone(null);
         this.updateInterceptor = new MsgInterceptor(this.connGlobal, log, null);
         this.connGlobal.getXmlBlasterAccess().connect(new ConnectQos(this.connGlobal), this.updateInterceptor);
         SubscribeQos subQos = new SubscribeQos(this.connGlobal);
         subQos.setWantInitialUpdate(false);
         this.connGlobal.getXmlBlasterAccess().subscribe(new SubscribeKey(this.connGlobal, this.oid), subQos);
      }
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.