Package org.xmlBlaster.util.queue

Examples of org.xmlBlaster.util.queue.I_EntryFilter


    * Currently not supported by I_Queue.
    */
   public ArrayList take(int numOfEntries, long numOfBytes) throws XmlBlasterException {
      if (numOfEntries == 0) return new ArrayList();
      ArrayList ret = null;
      I_EntryFilter entryFilter = null;
      synchronized(this.modificationMonitor) {
         try {
            ret = this.manager.getEntries(getStorageId(), numOfEntries, numOfBytes, entryFilter);

            long ids[] = new long[ret.size()];
View Full Code Here


   /**
    * @see I_Queue#peek()
    */
   public I_QueueEntry peek() throws XmlBlasterException
   {
      I_EntryFilter entryFilter = null;
      ArrayList ret = this.manager.getEntries(getStorageId(), 1, -1L, entryFilter);
      if (ret.size() < 1) return null;
      return (I_QueueEntry)ret.get(0);
   }
View Full Code Here

   /**
    * @see I_Queue#peek(int,long)
    */
   public ArrayList peek(int numOfEntries, long numOfBytes) throws XmlBlasterException {
      if (numOfEntries == 0) return new ArrayList();
      I_EntryFilter entryFilter = null;
      ArrayList ret = this.manager.getEntries(getStorageId(), numOfEntries, numOfBytes, entryFilter);
      return ret;
   }
View Full Code Here

   /**
    * @see I_Queue#peekWithPriority(int, long, int, int)
    */
   public ArrayList peekWithPriority(int numOfEntries, long numOfBytes, int minPriority, int maxPriority) throws XmlBlasterException {
      if (numOfEntries == 0) return new ArrayList();
      I_EntryFilter entryFilter = null;
      ArrayList ret = this.manager.getEntriesByPriority(getStorageId(), numOfEntries, numOfBytes, minPriority, maxPriority, entryFilter);
      return ret;
   }
View Full Code Here

    * @see I_Map#embeddedObjectsToXml(OutputStream, Properties)
    */
   public long embeddedObjectsToXml(final OutputStream out, final Properties props) throws Exception {
      if (out == null) return 0;
      entryCounter = 0;
      /*I_Entry[] results = */getAll(new I_EntryFilter() {
         public I_Entry intercept(I_Entry entry, I_Storage storage) {
            entryCounter++;
            try {
               entry.embeddedObjectToXml(out, props);
            }
View Full Code Here

         //log.error(ME, "getAll() DEBUG ONLY: numSwapped=" + numSwapped() + " transient=" + this.transientStore.getNumOfEntries() + " persistentStore=" + this.persistentStore.getNumOfEntries());
         java.util.Map map = new java.util.TreeMap(); // To suppress same entry twice and to be sorted (sorted is not yet specified to be necessary)
        
         I_MapEntry[] ramEntries = null;
         if (entryFilter != null) {
            ramEntries = this.transientStore.getAll(new I_EntryFilter() {
               public I_Entry intercept(I_Entry entry, I_Storage storage) {
                  if (entry.isPersistent())
                        return null; // take the one from persistent store
                  return entryFilter.intercept(entry, storage);
               }
View Full Code Here

                  "')  ORDER BY " + this.dataIdColName + " ASC";
         }
         if (log.isLoggable(Level.FINE)) log.fine("Request: '" + req + "'");

         query = new PreparedQuery(pool, req, numOfEntries);
         I_EntryFilter entryFilter = null;
         ArrayList ret = processResultSet(query.rs, storageId, numOfEntries, numOfBytes, false, entryFilter);
         if (log.isLoggable(Level.FINE)) log.fine("Found " + ret.size() + " entries");
         return ret;
      }
      catch (XmlBlasterException ex) {
View Full Code Here

      if (log.isLoggable(Level.FINE)) log.fine("Request: '" + req + "'");
      PreparedQuery query = null;
      boolean success = true;
      try {
         query = new PreparedQuery(pool, req, -1);
         I_EntryFilter entryFilter = null;
         ArrayList ret = processResultSet(query.rs, storageId, -1, -1L, false, entryFilter);
         if (log.isLoggable(Level.FINE)) log.fine("Found " + ret.size() + " entries");
         return ret;
      }
      catch (XmlBlasterException ex) {
View Full Code Here

    * Currently not supported by I_Queue.
    */
   public ArrayList take(int numEntries, long numBytes) throws XmlBlasterException {
      if (numEntries == 0) return new ArrayList();
      ArrayList ret = null;
      I_EntryFilter entryFilter = null;
      synchronized(this.modificationMonitor) {
         try {
            final boolean isRef = true;
            ret = (ArrayList)databaseAccessor.getEntries(xbStore, numEntries, numBytes, entryFilter, isRef, this);

View Full Code Here

   /**
    * @see I_Queue#peek()
    */
   public I_QueueEntry peek() throws XmlBlasterException
   {
      I_EntryFilter entryFilter = null;
      final boolean isRef = true;
      List/*<I_Entry>*/ ret = databaseAccessor.getEntries(xbStore, 1, -1L, entryFilter, isRef, this);
      if (ret.size() < 1) return null;
      return (I_QueueEntry)ret.get(0);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.queue.I_EntryFilter

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.