Package org.xmlBlaster.util.qos.address

Examples of org.xmlBlaster.util.qos.address.CallbackAddress


   private Client doConnect(String loginName, I_Callback cb) {
      try {
         Client client = new Client();
         Global gg = this.glob.getClone(null);
         ConnectQos connectQos = new ConnectQos(gg, loginName, "secret");
         CallbackAddress cbAddress = new CallbackAddress(glob);
         cbAddress.setRetries(-1);       // -1 == forever to avoid server side clearing of queue
         connectQos.addCallbackAddress(cbAddress);
         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
View Full Code Here


         con.registerConnectionListener(this);
         connectQos.setAddress(addressProp);
        
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
            CallbackAddress cbAddress = new CallbackAddress(tmpGlobal);
            cbAddress.setRetries(-1);
            cbAddress.setPingInterval(-1);
            cbAddress.setDelay(1000L);
            cbAddress.setSecretCbSessionId("someSecredSessionId");
            connectQos.addCallbackAddress(cbAddress);
         }
         con.connect(connectQos, this);
         DisconnectQos disconnectQos = new DisconnectQos(tmpGlobal);
         con.disconnect(disconnectQos);
      }
      catch (XmlBlasterException e) {
          log.warning("setUp() - login failed: " + e.getMessage());
          fail("setUp() - login fail: " + e.getMessage());
      }
      catch (Exception e) {
          log.severe("setUp() - login failed: " + e.toString());
          e.printStackTrace();
          fail("setUp() - login fail: " + e.toString());
      }

      System.out.println("============== Connect for general/1");

      try {
         I_XmlBlasterAccess con = this.glob.getXmlBlasterAccess(); // Find orb

         String passwd = "secret";
         ConnectQos connectQos = new ConnectQos(this.glob, senderName, passwd); // == "<qos>...</qos>";
         connectQos.setSessionName(new SessionName(this.glob, "general/1"));
         // set the persistent connection
         connectQos.setPersistent(this.persistent);
         // Setup fail save handling for connection ...
         Address addressProp = new Address(glob);
         addressProp.setDelay(reconnectDelay); // retry connecting every 2 sec
         addressProp.setRetries(-1);       // -1 == forever
         addressProp.setPingInterval(-1L); // switched off
         con.registerConnectionListener(this);
         connectQos.setAddress(addressProp);
        
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
            CallbackAddress cbAddress = new CallbackAddress(this.glob);
            cbAddress.setRetries(-1);
            cbAddress.setPingInterval(-1);
            cbAddress.setDelay(1000L);
            cbAddress.setSecretCbSessionId("someSecredSessionId");
            connectQos.addCallbackAddress(cbAddress);
         }

         con.connect(connectQos, this)// Login to xmlBlaster, register for updates
      }
View Full Code Here

         addressProp.setPingInterval(-1L); // switched off
         connectQos.setAddress(addressProp);
     
         // setup failsafe handling for callback ...
         if (this.failsafeCallback) {
            CallbackAddress cbAddress = new CallbackAddress(this.glob);
            cbAddress.setRetries(-1);
            cbAddress.setPingInterval(-1);
            cbAddress.setDelay(1000L);
            connectQos.addCallbackAddress(cbAddress);
         }
         con.connect(connectQos, this)// Login to xmlBlaster, register for updates
         if (expectEx) assertTrue("an exception was expected here because of overflow: Configuration of session queue probably not working", false);
         return ret;
View Full Code Here

      Util.gc(2);
      int threadsBefore = ThreadLister.countThreads();
      for (int ii=0; ii<20; ii++) {
         System.out.println("Hit a key for ORB #" + ii + "/20");
         try { System.in.read(); } catch(java.io.IOException e) {}
         ORB orb = OrbInstanceFactory.createOrbInstance(glob, new String[0], null, new CallbackAddress(glob));
         try {
            POA rootPOA = org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
            rootPOA.the_POAManager().activate();
         }
         catch (Throwable e) {
View Full Code Here

   private void login() {
      try {
         String passwd = "secret";

         cbServer = new CorbaCallbackServer();
         CallbackAddress cba = new CallbackAddress(this.glob);
         cbServer.initialize(this.glob, loginName, cba, this);

         corbaConnection = new CorbaConnection();
         corbaConnection.init(glob, null);
         //cbServer = new CorbaCallbackServer(this.glob, loginName, this, corbaConnection.getOrb());
View Full Code Here

            System.out
                  .println("  java javaclients.email.DelegateDemo -protocol email -emailDestination blue@localhost");
            System.exit(1);
         }

         CallbackAddress cbAddr = new CallbackAddress(this.glob, "email");
         cbAddr.setRawAddress(receiver);
         cbAddr.setOneway(true);
         qos.addCallbackAddress(cbAddr);

         // null: Login to xmlBlaster without callback instantiation!
         con.connect(qos, null);
View Full Code Here

         // Connecting to server
         log.info("Connecting with XmlRpc ...");
         this.con = glob.getXmlBlasterAccess();
         this.connectQos = new ConnectQos(glob, name, passwd);

         CallbackAddress cbAddress = new CallbackAddress(glob);
         cbAddress.setDelay(1000L);      // retry connecting every 4 sec
         cbAddress.setRetries(-1);       // -1 == forever
         cbAddress.setPingInterval(5000L); // ping every 4 seconds
         cbAddress.setDispatchPlugin("Priority,1.0")// Activate plugin for callback only
         this.connectQos.addCallbackAddress(cbAddress);

         this.con.connect(this.connectQos, this.updateInterceptor);
      }
      catch (Exception e) {
View Full Code Here

         updateMsgs = new MsgInterceptor(glob, log, null); // just used as message container
         this.updateInterceptor.clear();
         try {
            // TODO change this since it can not work when using xmlrpc with singleChannel=true
            cbServer = new XmlRpcCallbackServer();
            CallbackAddress cbAddress = new CallbackAddress(glob);
            cbServer.initialize(this.glob, name, cbAddress, new AbstractCallbackExtended(glob) {
               public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException {
                  try {
                     String contentStr = new String(content);
                     String cont = (contentStr.length() > 10) ? (contentStr.substring(0,10)+"...") : contentStr;
View Full Code Here

         // we need failsafe behaviour to enable holdback messages on client update exceptions
         ConnectQos connectQos = new ConnectQos(this.connGlobal, "streamingMsgTester/1", "secret");
         connectQos.getAddress().setDelay(5000L);
         connectQos.getAddress().setPingInterval(5000L);
         connectQos.getAddress().setRetries(-1);
         CallbackAddress cbAddr = new CallbackAddress(this.global);
         cbAddr.setDelay(5000L);
         cbAddr.setPingInterval(5000L);
         cbAddr.setRetries(-1);
         connectQos.addCallbackAddress(cbAddr);
         XmlBlasterAccess access = (XmlBlasterAccess)this.connGlobal.getXmlBlasterAccess();
         ConnectReturnQos retQos = access.connect(connectQos, this.updateInterceptor, withQueue);
         log.info("connect return qos: " + retQos.toXml());
        
View Full Code Here

         log.info("Connecting first ...");
         this.con = glob.getXmlBlasterAccess();

         ConnectQos qos = new ConnectQos(glob, "JOE/1", "secret");

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

         SessionQos sessionQos = qos.getSessionQos();
         sessionQos.setMaxSessions(1);
         sessionQos.setReconnectSameClientOnly(true);
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.qos.address.CallbackAddress

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.