Package org.xmlBlaster.util.qos

Examples of org.xmlBlaster.util.qos.SessionQos


      public String toString() {
         String s = super.toString();
         String q = "";
         if ( retQos != null) {
            SessionQos ses = retQos.getSessionQos() ;
            q =  "secretId="+ses.getSecretSessionId() + " publicId="+ses.getPublicSessionId();
         } // end of if ()
        
         return s+":"+state+" age="+getAgeSeconds()+" seconds old, (thread="+internalThread.getName()+") "+q;
      }
View Full Code Here


         String newXml = qos.toXml();                  // dump
         qos = factory.readObject(newXml);             // parse again

         if (log.isLoggable(Level.FINE)) log.fine("ORIG=\n" + xml + "\n NEW=\n" + newXml);

         SessionQos sessionQos = qos.getSessionQos();
         assertEquals("sessionTimeout failed", sessionTimeout, sessionQos.getSessionTimeout());
         if (SessionName.useSessionMarker())
            assertEquals("", "/node/avalon/client/joe/session/2", sessionQos.getSessionName().getAbsoluteName());
         else
            assertEquals("", "/node/avalon/client/joe/2", sessionQos.getSessionName().getAbsoluteName());
         assertEquals("", true, sessionQos.hasPublicSessionId());
         assertEquals("", 2L, sessionQos.getPublicSessionId());
         assertEquals("", sessionTimeout, sessionQos.getSessionTimeout());
         assertEquals("", 27, sessionQos.getMaxSessions());
         assertEquals("", true, sessionQos.clearSessions());
         assertEquals("", "xyz", sessionQos.getSecretSessionId());

         assertEquals("", false, qos.isPtpAllowed());
         assertEquals("", true, qos.isClusterNode());
         assertEquals("", true, qos.isReconnected());
         assertEquals("", "/node/heron/instanceId/123445", qos.getInstanceId());
View Full Code Here

         CallbackAddress callback = new CallbackAddress(glob);
         callback.setPingInterval(1000);
         qos.addCallbackAddress(callback);

         SessionQos sessionQos = qos.getSessionQos();
         sessionQos.setMaxSessions(1);
         sessionQos.setReconnectSameClientOnly(true);
         this.con.connect(qos, this);
      }
      catch (Exception e) {
         Thread.dumpStack();
         fail(ME+": Can't connect to xmlBlaster: " + e.toString());
      }

      try {
         log.info("Connecting other ...");
         Global glob2 = glob.getClone(null);
         I_XmlBlasterAccess con2 = glob2.getXmlBlasterAccess();

         // 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());
      }

      // boolean isSocket = Client
      // boolean isRpc = (this.con.getCbServer() instanceof XmlRpcCallbackImpl);

      try {
         Client.shutdownCb(con, Client.Shutdown.LEAVE_SERVER);
      }
      catch (XmlBlasterException e) {
         fail("Can't setup test: " + e.getMessage());
      }
      try { Thread.sleep(2000); } catch( InterruptedException i) {} // Wait

      try {
         log.info("Connecting other ...");
         Global glob2 = glob.getClone(null);
         I_XmlBlasterAccess con2 = glob2.getXmlBlasterAccess();

         // 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

TOP

Related Classes of org.xmlBlaster.util.qos.SessionQos

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.