Package org.xmlBlaster.engine

Examples of org.xmlBlaster.engine.TopicHandler


      this.global = global;

      if (log.isLoggable(Level.FINER)) log.finer("init");
      this.pluginInfo = pluginInfo;
      this.serverScope = (org.xmlBlaster.engine.ServerScope)this.global.getObjectEntry(Constants.OBJECT_ENTRY_ServerScope);
      TopicHandler topicHandler = (TopicHandler)this.pluginInfo.getUserData();
      this.topicId = topicHandler.getUniqueKey();
      this.isReady = true;
      toRunning();
   }
View Full Code Here


      if (log.isLoggable(Level.FINER)) log.finer("processQueue");
      try {
         List<I_Entry> lst = null;
         while (true) {
            //synchronized(this) {
               TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
               try {
                  I_Queue historyQueue = topicHandler.getHistoryQueue();
                  if (historyQueue == null) {
                     this.isRunning = false;
                     break;
                  }
                  lst = historyQueue.peek(-1, -1L);
View Full Code Here

         SubscriptionInfo[] subInfoArr = (SubscriptionInfo[])subInfoList.toArray(new SubscriptionInfo[subInfoList.size()]);
         for (int ii=0; ii<subInfoArr.length; ii++) {
            SubscriptionInfo sub = subInfoArr[ii];
            if (TopicHandler.isDirtyRead(sub, msgUnitWrapper)) {
               log.severe("ConsumableQueuePlugin used together with 'dirtyRead' is not supported");
               TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
               if (topicHandler == null) return true;
               try {
                  I_Queue srcQueue = topicHandler.getHistoryQueue();
                  if (srcQueue != null) srcQueue.removeRandom(entry);
               }
               finally {
                  this.serverScope.getTopicAccessor().release(topicHandler);
               }
               return true; // even if it has not been sent
            }
         }  

         for (int ii=0; ii<subInfoArr.length; ii++) {
            SubscriptionInfo sub = subInfoArr[ii];
           
            if (!TopicHandler.subscriberMayReceiveIt(sub, msgUnitWrapper)) continue;
            //Has no effect:
            //if (!this.topicHandler.checkIfAllowedToSend(null, sub)) continue;

            // this is specific for this plugin
            if (sub.getSessionInfo().getDispatchManager() == null) continue;
            if (!sub.getSessionInfo().getDispatchManager().getDispatchConnectionsHandler().isAlive()) continue;

            try {

               try {
                  TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
                  if (topicHandler == null) return true;
                  try {
                     // the 'false' here is to tell the filter not to send a dead letter in case of an ex
                     if (!topicHandler.checkFilter(null, sub, msgUnitWrapper, false)) continue;
                  }
                  finally {
                     this.serverScope.getTopicAccessor().release(topicHandler);
                  }
               }
               catch (XmlBlasterException ex) {
                  // continue;
                  givingUpDistribution(sub, msgUnitWrapper, entry, ex);
                  return true; // because the entry has been removed from the history queue
               }

               // put the current dispatcher at the end of the list for next invocation (round robin)
               subInfoList.remove(sub);
               subInfoList.add(sub);
              
               MsgQueueUpdateEntry updateEntry = TopicHandler.createEntryFromWrapper(msgUnitWrapper,sub);

               UpdateReturnQosServer retQos = doDistribute(sub, updateEntry);

               if (log.isLoggable(Level.FINE)) {
                  if (retQos == null) log.fine("distributeOneEntry: the return object was null: callback has not sent the message (dirty reads ?)");
               }
               if (retQos == null || retQos.getException() == null) {
                  TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
                  if (topicHandler == null) return true;
                  try {
                     I_Queue srcQueue = topicHandler.getHistoryQueue();
                     if (srcQueue != null) srcQueue.removeRandom(entry); // success
                  }
                  finally {
                     this.serverScope.getTopicAccessor().release(topicHandler);
                  }
View Full Code Here

            sub.getSessionInfo().getDispatchManager().internalError(e); // calls MsgErrorHandler
         else {
            this.serverScope.getRequestBroker().deadMessage(new MsgQueueEntry[] { entry }, null, ME + ".givingUpDistribution: " + exTxt);
         }
         // remove the entry from the history queue now that a dead letter has been sent.
         TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
         try {
            I_Queue historyQueue = topicHandler.getHistoryQueue();
            if (historyQueue != null)
               historyQueue.removeRandom(entry);
         }
         finally {
            this.serverScope.getTopicAccessor().release(topicHandler);
View Full Code Here

      else if (registerKey.equals(ContextNode.TOPIC_MARKER_TAG)) { // "topic"
         String topicId = cmd.getUserNameLevel();
         if (topicId == null || topicId.length() < 1 || topicId.startsWith("?"))
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid topicId in '" + cmd.getCommand() + "' with '" + topicId + "' is invalid");

         TopicHandler topicHandler = this.glob.getTopicAccessor().access(topicId);
         if (topicHandler == null)
            throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid topicId in '" + cmd.getCommand() + "' topicId '" + topicId + "' is unknown");
         try {
            String methodName = cmd.getFifthLevel();
            if (methodName == null || methodName.length() < 1)
View Full Code Here

TOP

Related Classes of org.xmlBlaster.engine.TopicHandler

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.