Package org.xmlBlaster.util.qos.address

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


         sb.append(" onFailure='").appendAttributeEscaped(getOnFailure()).append("'");

      if (addressArr.length > 0 && addressArr[0] != null) {
         sb.append(">");
         for (int ii=0; ii<addressArr.length; ii++) {
            AddressBase ad = addressArr[ii];
            sb.append(ad.toXml(extraOffset+Constants.INDENT));
         }
         sb.append(offset).append("</").append(getRootTagName()).append(">")// closing </queue>
      }
      else
         sb.append("/>");
View Full Code Here


            assertEquals("", "RAM", prop.getType());
            assertEquals("", "4.0", prop.getVersion());
            assertEquals("", 44L, prop.getMaxBytes());
            AddressBase[] addrArr = prop.getAddresses();
            assertEquals("Address array", 1, addrArr.length);
            AddressBase addr = addrArr[0];
            assertEquals("", "34", addr.getEnv("intKey2", "").getValue());
         }

         {
            CbQueueProperty prop = qos.getSubjectQueueProperty();
            assertEquals("", 1009L, prop.getMaxEntries());
            assertEquals("", "XY", prop.getType());
            assertEquals("", "7.0", prop.getVersion());
            assertEquals("", 4009L, prop.getMaxBytes());
            assertEquals("", 509L, prop.getMaxEntriesCache());
            assertEquals("", 777L, prop.getMaxBytesCache());
            /* Currently deactivated in code
            assertEquals("", 20009L, prop.getStoreSwapLevel());
            assertEquals("", 10000L, prop.getStoreSwapBytes());
            assertEquals("", 20000L, prop.getReloadSwapLevel());
            assertEquals("", 30000L, prop.getReloadSwapBytes());
            */
            assertEquals("", "deadMessage", prop.getOnOverflow());
            assertEquals("", true, qos.hasSubjectQueueProperty());
         }


         {
            CbQueueProperty prop = qos.getSessionCbQueueProperty();
            assertEquals("", 1600L, prop.getMaxEntries());
            AddressBase[] addrArr = prop.getAddresses();
            assertEquals("Address array", 1, addrArr.length);
            AddressBase addr = addrArr[0];
            assertEquals("", 400, addr.getCollectTime());
            assertEquals("", 12, addr.getBurstModeMaxEntries());
            assertEquals("", 24, addr.getBurstModeMaxBytes());
            assertEquals("", "1234", addr.getEnv("intKey1", "").getValue());
            System.out.println("GOT: "+addr.getRawAddress());
            assertEquals("", "http:/www.mars.universe:8080/RPC2", addr.getRawAddress());
         }

         assertEquals("Wrong number of clientProperties", 2, qos.getClientProperties().size());
         {
            String prop = qos.getClientProperty("StringKey", (String)null);
View Full Code Here

            CbQueueProperty prop = qos.getSessionCbQueueProperty();
            assertEquals("", 1600L, prop.getMaxEntries());
            assertEquals("", 2000L, prop.getMaxBytes());
            AddressBase[] addrArr = prop.getAddresses();
            assertEquals("Address array", 1, addrArr.length);
            AddressBase addr = addrArr[0];
            assertEquals("", "golan@localhost", addr.getRawAddress());
            assertEquals("", "/xmlBlaster/node/heron/client/golan/session/1", addr.getEnv("__ContextNode", "").getValue());
            assertEquals("", "email", addr.getType());
            assertEquals("", 56, addr.getBootstrapPort());
            assertEquals("", "99i8Z", addr.getSecretSessionId());
            assertEquals("", 30000, addr.getPingInterval());
            assertEquals("", 12, addr.getRetries());
            assertEquals("", 20005, addr.getDelay());
         }

      }
      catch (XmlBlasterException e) {
         fail("testParse failed: " + e.toString());
View Full Code Here

   void toAlive(ConnectionStateEnum oldState) {

      if (log.isLoggable(Level.FINER)) log.finer(ME+": Switch from " + oldState + " to ALIVE");

      // Remember the current collectTime
      AddressBase addr = this.dispatchConnectionsHandler.getAliveAddress();
      if (addr == null) {
         log.severe(ME+": toAlive action has no alive address");
         return;
      }

      try {
         this.inAliveTransition = true;

         if (this.toAliveTime <= this.toPollingTime) {
            this.toAliveTime = System.currentTimeMillis();
         }

         this.burstModeMaxEntries = addr.getBurstModeMaxEntries();
         this.burstModeMaxBytes = addr.getBurstModeMaxBytes();

         synchronized (this.ALIVE_TRANSITION_MONITOR) {
            // 1. We allow a client to intercept and for example destroy all entries in the queue
            I_ConnectionStatusListener[] listeners = getConnectionStatusListeners();
            for (int i=0; i<listeners.length; i++) {
               listeners[i].toAlive(this, oldState);
            }
            // 2. If a dispatch plugin is registered it may do its work
            if (this.msgInterceptor != null)
               this.msgInterceptor.toAlive(this, oldState);
         }
      }
      finally {
         this.inAliveTransition = false;
      }

      collectTime = addr.getCollectTime(); // burst mode if > 0L

      // 3. Deliver. Will be delayed if burst mode timer is activated, will switch to sync mode if necessary
      activateDispatchWorker();

      if (this.shallCallToAliveSync && !this.inDispatchManagerCtor && this.isSyncMode)
View Full Code Here

TOP

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

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.