Package org.xmlBlaster.util.queue

Examples of org.xmlBlaster.util.queue.I_Queue


   /**
    * Put the given message entry into the queue
    */
   public final void queueMessage(MsgQueueEntry entry) throws XmlBlasterException {
      I_Queue sessionQueue = this.sessionQueue;
      if (!hasCallback() || sessionQueue == null) {
         if (log.isLoggable(Level.FINE)) log.fine(ME+": Queing PtP message without having configured a callback to the client, the client needs to reconnect with a valid callback address later");
         //if (!connectQos.getSessionName().isPubSessionIdUser()) { // client has specified its own publicSessionId (> 0)
         //   throw new XmlBlasterException(glob, ErrorCode.USER_CONFIGURATION, ME, "No callback server is configured, can't callback client to send message " + entry.getKeyOid());
         //}
      }
      if (getPublicSessionId() < 0 && entry.isPersistent()) {
         entry.setPersistent(false);
         if (!this.transientWarn) {
            log.warning(ME+": Handling persistent messages in callback queue as transient as we have a login session with a negative public session id (we can't reconnect to same queue after restart)");
            this.transientWarn = true;
         }
      }
      sessionQueue.put(entry, I_Queue.USE_PUT_INTERCEPTOR);

      I_Checkpoint cp = glob.getCheckpointPlugin();
      if (cp != null) {
         cp.passingBy(I_Checkpoint.CP_UPDATE_QUEUE_ADD, entry.getMsgUnit(),
                  this.getSessionName(), null);
View Full Code Here


      if (newConnectQos.getData().getClientProperty(Constants.CLIENTPROPERTY_REMOTEPROPERTIES, false)) {
          mergeRemoteProperties(newConnectQos.getData().getClientProperties());
      }

      CbQueueProperty cbQueueProperty = newConnectQos.getSessionCbQueueProperty();
      I_Queue sessionQueue = this.sessionQueue;
      if (sessionQueue != null) sessionQueue.setProperties(cbQueueProperty);
      if (wantsCallbacks && hasCallback()) {
         DispatchManager dispatchManager = this.dispatchManager;
         if (dispatchManager != null) {
            dispatchManager.updateProperty(cbQueueProperty.getCallbackAddresses());
            log.info(ME+": Successfully reconfigured callback address with new settings, other reconfigurations are not yet implemented");
View Full Code Here

   public void changed(I_Storage storage, long numEntries, long numBytes, boolean isShutdown) {
      if (isShutdown) return;
      SubjectInfo subjectInfo = getSubjectInfo();
      boolean hasSubjectEntries = (subjectInfo == null) ? false : subjectInfo.getSubjectQueue().getNumOfEntries() > 0;
      if (lastNumEntries != numEntries) {
         I_Queue sessionQueue = this.sessionQueue;
         long max = (sessionQueue == null) ? 0 : sessionQueue.getMaxNumOfEntries();
         if (hasSubjectEntries && numEntries < max && lastNumEntries > numEntries) {
            if (log.isLoggable(Level.FINE)) log.fine(ME+": SessionQueue has emptied from " + lastNumEntries +
                           " to " + numEntries + " entries, calling SubjectInfoShuffler.shuffle()");
            this.glob.getSubjectInfoShuffler().shuffle(subjectInfo);
         }
View Full Code Here

      }
      else {
         sb.append(offset).append(Constants.INDENT).append("<DispatchManager id='NULL'/>");
      }

      I_Queue sessionQueue = this.sessionQueue;
      if (sessionQueue != null) {
         sb.append(sessionQueue.toXml(extraOffset+Constants.INDENT));
      }
      sb.append(offset).append("</SessionInfo>");

      return sb.toString();
   }
View Full Code Here

      if (this.sessionQueue == null) return 0L;
      return this.sessionQueue.getNumOfBytes();
   }

   public final long getCbQueueBytesCache() {
      I_Queue sq = this.sessionQueue;
      if (sq == null) return 0L;
      if (sq instanceof CacheQueueInterceptorPlugin) {
         CacheQueueInterceptorPlugin cq = (CacheQueueInterceptorPlugin)sq;
         I_Queue tq = cq.getTransientQueue();
         if (tq != null) return tq.getNumOfBytes();
         return 0L;
      }
      return -1L;
   }
View Full Code Here

      }
      return -1L;
   }

   public final long getCbQueueNumMsgsCache() {
      I_Queue sq = this.sessionQueue;
      if (sq == null) return 0L;
      if (sq instanceof CacheQueueInterceptorPlugin) {
         CacheQueueInterceptorPlugin cq = (CacheQueueInterceptorPlugin)sq;
         I_Queue tq = cq.getTransientQueue();
         if (tq != null) return tq.getNumOfEntries();
         return 0L;
      }
      return -1L;
   }
View Full Code Here

      if (this.sessionQueue == null) return 0L;
      return this.sessionQueue.getMaxNumOfEntries();
   }

   public final long getCbQueueMaxMsgsCache() {
      I_Queue sq = this.sessionQueue;
      if (sq == null) return 0L;
      if (sq instanceof CacheQueueInterceptorPlugin) {
          CacheQueueInterceptorPlugin cq = (CacheQueueInterceptorPlugin)sq;
          I_Queue tq = cq.getTransientQueue();
          if (tq != null) return tq.getMaxNumOfEntries();
          return 0L;
      }
      return -1L;
   }
View Full Code Here

         throw new Exception(e.toString());
      }
   }

   public long clearCallbackQueue() {
      I_Queue sessionQueue = this.sessionQueue;
      return (sessionQueue==null) ? 0L : sessionQueue.clear();
   }
View Full Code Here

      I_Queue sessionQueue = this.sessionQueue;
      return (sessionQueue==null) ? 0L : sessionQueue.clear();
   }

   public long removeFromCallbackQueue(long numOfEntries) throws XmlBlasterException {
      I_Queue sessionQueue = this.sessionQueue;
      return (sessionQueue==null) ? 0L : sessionQueue.removeNum(numOfEntries);
   }
View Full Code Here

TOP

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

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.