Package org.xmlBlaster.client

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


      try {
         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();

         ConnectQos qos = new ConnectQos(glob);
         con.connect(qos, this)// Login to xmlBlaster, register for updates

         PublishKey pk = new PublishKey(glob, "Latency", "text/xml", "1.0");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());
View Full Code Here


        
         I_XmlBlasterAccess client = glob.getXmlBlasterAccess();
        
         log.info("Going to invoke xmlBlaster using XmlRpc-I_XmlBlasterAccess");
         ConnectQos connectQos = new ConnectQos(glob, "LunaMia", "silence");
         client.connect(connectQos, null);
         log.info("Connection successful");

         String contentString = "This is a simple Test Message for the xml-rpc Protocol";
         byte[] content = contentString.getBytes();
View Full Code Here

            // (This is redundant as it is done by ConnectQos already)
            String name = con.getGlobal().getProperty().get("session.name", "AllProtocols");
            String passwd = con.getGlobal().getProperty().get("passwd", "secret");

            ConnectQos qos = new ConnectQos(con.getGlobal(), name, passwd);
            con.connect(qos, this)// Login to xmlBlaster, register for updates


            PublishKey pk = new PublishKey(con.getGlobal(), "AllProtocols", "text/xml", "1.0");
            pk.setClientTags("<org.xmlBlaster><demo/></org.xmlBlaster>");
            PublishQos pq = new PublishQos(con.getGlobal());
View Full Code Here

         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(glob, senderName, passwd); // == "<qos>...</qos>";
         // set the persistent connection
         connectQos.setPersistent(false);
         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());
          fail("setUp() - login fail: " + e.getMessage());
      }
View Full Code Here

            ConnectQos connectQos = new ConnectQos(glob);
            Address address = new Address(glob);
            address.setBootstrapPort(8999); // a wrong port to avoid connection
            address.setRetries(0);       // switch off polling
            connectQos.setAddress(address);
            xmlBlasterAccess.connect(connectQos, null);
            fail("Not expected successful connect");
         }
         catch (XmlBlasterException e) {
            if (e.isErrorCode(ErrorCode.COMMUNICATION_NOCONNECTION_DEAD))
               log.info("Exception is OK if not connected: " + e.getErrorCode());
View Full Code Here

         log.info("Connecting ...");
         Global glob = this.glob.getClone(null);
         I_XmlBlasterAccess con = glob.getXmlBlasterAccess();
         ConnectQos qos = new ConnectQos(glob, name, passwd);
         qos.setMaxSessions(-16);
         con.connect(qos, this); // Login to xmlBlaster
         assertTrue("Connecting with zero sessions should not be possible", false);
      }
      catch (Exception e) {
         log.info("Success, can't connect with zero sessions");
      }
View Full Code Here

         // Activate plugin for callback only:
         ConnectQos qos = new ConnectQos(glob2, "JOE/1", "secret");
         SessionQos sessionQos = qos.getSessionQos();
         sessionQos.setMaxSessions(1);
         sessionQos.setReconnectSameClientOnly(true);
         con2.connect(qos, this);
         fail(ME+": Reconnect to xmlBlaster should not be possible");
      }
      catch (XmlBlasterException e) {
         log.info("SUCCESS, reconnect is not possible: " + e.getMessage());
      }
View Full Code Here

         // Activate plugin for callback only:
         ConnectQos qos = new ConnectQos(glob2, "JOE/1", "secret");
         SessionQos sessionQos = qos.getSessionQos();
         sessionQos.setMaxSessions(1);
         sessionQos.setReconnectSameClientOnly(true);
         con2.connect(qos, this);
         log.info("SUCCESS, reconnect is OK after first session died");
      }
      catch (XmlBlasterException e) {
         fail(ME + ": Reconnect should now be possible: " + e.getMessage());
      }
View Full Code Here

      try {
         try {
            con = glob.getXmlBlasterAccess();
            ConnectQos qos = new ConnectQos(glob, name, passwd);
            qos.setSessionTimeout(timeout);
            con.connect(qos, this);
         }
         catch (Exception e) {
            log.severe(e.toString());
            assertTrue("Login failed" + e.toString(), false);
         }
View Full Code Here

         try {
            con = glob.getXmlBlasterAccess();
            ConnectQos qos = new ConnectQos(glob, name, passwd);
            qos.setRefreshSession(true);
            qos.setSessionTimeout(timeout);
            con.connect(qos, this);
         }
         catch (Exception e) {
            log.severe(e.toString());
            assertTrue("Login failed" + e.toString(), false);
         }
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.