Examples of PriorityEnum


Examples of org.xmlBlaster.util.def.PriorityEnum

   public void testClearWithSwappedEntries() {
      String queueType = "CACHE";
      try {
         StorageId id = config(20L, 3L, 500L, 100L);
         PriorityEnum prio = PriorityEnum.toPriorityEnum(5);
         for (int i=0; i < 15; i++) {
            boolean persistent =  (i | 1) == 0; // some persistent and some transient
            long entrySize = 10L;
            DummyEntry entry = new DummyEntry(glob, prio, id, entrySize, persistent);
            this.queue.put(entry, true);
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

                        log.info("putPeekRemove " + queueId + " persistent: " + persistentEntries.length + " transient: " + transients.length);

                        boolean persistent = false;
                        for (int i=0; i < transients.length; i++) {
                           int prio = i % 3;
                           PriorityEnum enumer = PriorityEnum.toPriorityEnum(prio+4);
                           DummyEntry entry = new DummyEntry(glob, enumer, refQueue.getStorageId(), entrySize, persistent);
                           transients[i] = entry;
                           inputTable[prio].put(new Long(entry.getUniqueId()), entry);
                        }
                        persistent = true;
                        for (int i=0; i < persistentEntries.length; i++) {
                           int prio = i % 3;
                           PriorityEnum enumer = PriorityEnum.toPriorityEnum(prio+4);
                           DummyEntry entry = new DummyEntry(glob, enumer, refQueue.getStorageId(), entrySize, persistent);
                           persistentEntries[i] = entry;
                           inputTable[prio].put(new Long(entry.getUniqueId()), entry);
                        }
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

      int entries1 = 5;
      int entries2 = 10;

      this.queue.clear();
      DummyEntry[] entries = new DummyEntry[numOfEntries];
      PriorityEnum prio = PriorityEnum.toPriorityEnum(4);

      boolean persistent = false;
      for (int i=0; i < numOfEntries; i++) {
         persistent = (i % 2) == 0; // even are persistent uneven are transient
         entries[i] = new DummyEntry(glob, prio, this.queue.getStorageId(), entrySize, persistent);
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

         String domain = glob.getProperty().get("domain", (String)null);
         String clientTags = glob.getProperty().get("clientTags", "<org.xmlBlaster><demo/></org.xmlBlaster>");
         //String clientTags = glob.getProperty().get("clientTags", "<org.xmlBlaster><demo-%counter/></org.xmlBlaster>");
         String contentStr = glob.getProperty().get("content", "Hi-%counter");
         String contentFile = glob.getProperty().get("contentFile", (String)null);
         PriorityEnum priority = PriorityEnum.toPriorityEnum(glob.getProperty().get("priority", PriorityEnum.NORM_PRIORITY.getInt()));
         boolean persistent = glob.getProperty().get("persistent", true);
         long lifeTime = glob.getProperty().get("lifeTime", -1L);
         boolean forceUpdate = glob.getProperty().get("forceUpdate", true);
         boolean forceDestroy = glob.getProperty().get("forceDestroy", false);
         boolean readonly = glob.getProperty().get("readonly", false);
         long destroyDelay = glob.getProperty().get("destroyDelay", 60000L);
         boolean createDomEntry = glob.getProperty().get("createDomEntry", true);
         boolean consumableQueue = glob.getProperty().get("consumableQueue", false);
         long historyMaxMsg = glob.getProperty().get("queue/history/maxEntries", -1L);
         boolean forceQueuing = glob.getProperty().get("forceQueuing", true);
         boolean subscribable = glob.getProperty().get("subscribable", true);
         String destination = glob.getProperty().get("destination", (String)null);
         boolean erase = glob.getProperty().get("erase", true);
         boolean disconnect = glob.getProperty().get("disconnect", true);
         final boolean eraseTailback = glob.getProperty().get("eraseTailback", false);
         int contentSize = glob.getProperty().get("contentSize", -1); // 2000000);
         boolean eraseForceDestroy = glob.getProperty().get("erase.forceDestroy", false);
         boolean connectPersistent = glob.getProperty().get("connect/qos/persistent", false);

         Map clientPropertyMap = glob.getProperty().get("clientProperty", (Map)null);
         Map connectQosClientPropertyMap = glob.getProperty().get("connect/qos/clientProperty", (Map)null);

         if (historyMaxMsg < 1 && !glob.getProperty().propertyExists("destroyDelay"))
            destroyDelay = 24L*60L*60L*1000L; // Increase destroyDelay to one day if no history queue is used

         log.info("Used settings are:");
         log.info("   -interactive    " + interactive);
         log.info("   -sleep          " + Timestamp.millisToNice(sleep));
         log.info("   -oneway         " + oneway);
         log.info("   -erase          " + erase);
         log.info("   -disconnect     " + disconnect);
         log.info("   -eraseTailback  " + eraseTailback);
         log.info(" Pub/Sub settings");
         log.info("   -numPublish     " + numPublish);
         log.info("   -oid            " + oid);
         log.info("   -clientTags     " + clientTags);
         log.info("   -domain         " + ((domain==null)?"":domain));
         if (contentSize >= 0) {
            log.info("   -content        [generated]");
            log.info("   -contentSize    " + contentSize);
         }
         //else if (contentFile != null && contentFile.length() > 0) {
         //   log.info("   -contentFile    " + contentFile);
         //}
         else {
            log.info("   -content        " + contentStr);
            log.info("   -contentSize    " + contentStr.length());
            log.info("   -contentFile    " + contentFile);
         }
         log.info("   -priority       " + priority.toString());
         log.info("   -persistent     " + persistent);
         log.info("   -lifeTime       " + Timestamp.millisToNice(lifeTime));
         log.info("   -forceUpdate    " + forceUpdate);
         log.info("   -forceDestroy   " + forceDestroy);
         if (clientPropertyMap != null) {
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

      this.updateInterceptor.clear();
   }

   private void publish(String oid, int priority) {
      PriorityEnum prio = PriorityEnum.toPriorityEnum(priority);
      try {
         msgSequenceNumber++;
         String content = "" + msgSequenceNumber;
         PublishQos pq = new PublishQos(glob);
         pq.setPriority(prio);
         PublishReturnQos rq = con.publish(new MsgUnit("<key oid='"+oid+"'/>", content.getBytes(), pq.toXml()));
         log.info("SUCCESS publish '" + oid + "' with prio=" + prio.toString() + " returned state=" + rq.getState());
         assertEquals("Returned oid wrong", oid, rq.getKeyOid());
         assertEquals("Return not OK", Constants.STATE_OK, rq.getState());
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
         fail("publish prio=" + prio.toString() + " - XmlBlasterException: " + e.getMessage());
      }
   }
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

         fail("publish bandwidth state - XmlBlasterException: " + e.getMessage());
      }
   }

   private void publish(String oid, int priority) {
      PriorityEnum prio = PriorityEnum.toPriorityEnum(priority);
      try {
         msgSequenceNumber++;
         String content = "" + msgSequenceNumber;
         PublishQos pq = new PublishQos(glob);
         pq.setPriority(prio);
         PublishReturnQos rq = con.publish(new MsgUnit("<key oid='"+oid+"'/>", content.getBytes(), pq.toXml()));
         log.info("SUCCESS publish '" + oid + "' with prio=" + prio.toString() + " content=" + content + " returned state=" + rq.getState());
         assertEquals("Returned oid wrong", oid, rq.getKeyOid());
         assertEquals("Return not OK", Constants.STATE_OK, rq.getState());
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
         fail("publish prio=" + prio.toString() + " - XmlBlasterException: " + e.getMessage());
      }
   }
View Full Code Here

Examples of org.xmlBlaster.util.def.PriorityEnum

         throw new IllegalArgumentException(ME + ": Given priorityRange is empty, ignoring action=" + action.getAction());
      }

      check(getConnectionState(), action);

      PriorityEnum lower = PriorityEnum.parsePriority(lowerUpper[0]);
      PriorityEnum upper = lower;
      if (lowerUpper.length > 1) {
         upper = PriorityEnum.parsePriority(lowerUpper[1]);
      }

      if (lower.getInt() > upper.getInt()) { // swap if necessary
         PriorityEnum tmp = lower;
         lower = upper;
         upper = tmp;
      }

      for (int i=lower.getInt(); i<=upper.getInt(); i++) {
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.