Package org.xmlBlaster.client

Examples of org.xmlBlaster.client.I_Callback


    */
   public void testPublishPtP() {
      System.err.println("***PtPTest: Publish a message to a cluster slave ...");
      try {
         log.info("Login to heron and wait for PtP message ...");
         heronCon = serverHelper.connect(serverHelper.getHeronGlob(), new I_Callback() {  // Login to xmlBlaster, register for updates
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  log.info("Received message '" + updateKey.getOid() + "' state=" +
                           updateQos.getState() + " from '" + updateQos.getSender() + "'");
                  if (!updateQos.getSender().equalsAbsolute(bilboCon.getConnectReturnQos().getSessionName())) {
                     assertInUpdateHeron = serverHelper.getHeronGlob().getId() + ": Did not expect message update in default handler";
                  }
                  updateCounterHeron++;
                  return "";
               }
            });
         try { Thread.sleep(1000); } catch( InterruptedException i) {} // Wait some time
         assertTrue(assertInUpdateHeron, assertInUpdateHeron == null);
         assertInUpdateHeron = null;

         log.info("Login to bilbo to send PtP message ...");
         bilboCon = serverHelper.connect(serverHelper.getBilboGlob(), new I_Callback() {  // Login to xmlBlaster, register for updates
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                  assertInUpdateBilbo = serverHelper.getBilboGlob().getId() + ": Should not receive the message '" + updateKey.getOid() + "'";
                  fail(assertInUpdateBilbo); // This is routed to server, not to junit
                  return "";
               }
View Full Code Here


         System.err.println("->Connect to avalon ...");
         avalonCon = serverHelper.connect(serverHelper.getAvalonGlob(), null);

         {
            System.err.println("->Connect to bilbo ...");
            bilboCon = serverHelper.connect(serverHelper.getBilboGlob(), new I_Callback() {  // Login to xmlBlaster, register for updates
                  public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
                     updateCounterBilbo++;
                     log.info(
                              "Receiving update '" + updateKey.getOid() + "' state=" + updateQos.getState() +
                              " #" + updateCounterBilbo + " ...");
View Full Code Here

         ConnectQos connectQos = new ConnectQos(this.global, loginName, password);
         connectQos.setSecretCbSessionId(secretCbSessionId);
         // Constants.ONOVERFLOW_DISCARDOLDEST

         this.connection.connect(connectQos, new I_Callback() {
            public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
              
               if (!secretCbSessionId.equals(cbSessionId)) {
                  log.warning("Ignoring received message '" + updateKey.getOid() + "' because of wrong credentials '" + cbSessionId + "'");
                  return Constants.RET_OK;
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.I_Callback

Copyright © 2018 www.massapicom. 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.