Package org.xmlBlaster.util.dispatch.plugins

Examples of org.xmlBlaster.util.dispatch.plugins.I_MsgDispatchInterceptor


    */
   public void run(ArrayList entryList) throws XmlBlasterException {
      if (log.isLoggable(Level.FINER)) log.finer("Starting push remote dispatch of " + ((entryList!=null)?entryList.size():0) + " entries.");
      MsgQueueEntry[] entries = null;
      try {
         I_MsgDispatchInterceptor msgInterceptor = dispatchManager.getMsgDispatchInterceptor();
         if (msgInterceptor != null) {
            log.severe("Communication dispatch plugin support is missing in sync mode - not implemented");
            /*!!! filter or whatever
            try {
               entryList = msgInterceptor.handleNextMessages(dispatchManager, entryList); // should call prepareMsgsFromQueue() immediately
View Full Code Here


   public void run() {
      if (log.isLoggable(Level.FINER)) log.finer("Starting remote dispatch with " + this.msgQueue.getNumOfEntries() + " entries.");
      List<I_Entry> entryList = null;
      List<I_Entry> entryListChecked = null;
      try {
         I_MsgDispatchInterceptor msgInterceptor = dispatchManager.getMsgDispatchInterceptor();
         if (msgInterceptor != null) {
               entryListChecked = msgInterceptor.handleNextMessages(dispatchManager, null); // should call prepareMsgsFromQueue() immediately
               entryList = entryListChecked;
         }
         else {
            //synchronized (this.msgQueue) {
               //entryList = (MsgQueueEntry[])this.msgQueue.take(-1); --> get()
View Full Code Here

    * Messages are successfully sent, remove them now from queue (sort of a commit()):
    * We remove filtered/destroyed messages as well (which doen't show up in entryListChecked)
    * @param postSendNotify TODO
    */
   public void removeFromQueue(MsgQueueEntry[] entries, boolean postSendNotify) throws XmlBlasterException {
      I_MsgDispatchInterceptor msgInterceptor = getMsgDispatchInterceptor();
      MsgUnit[] msgUnits = null;
      if (msgInterceptor != null) { // we need to do this before removal since the msgUnits are weak references and would be deleted by gc
         msgUnits = new MsgUnit[entries.length];
         for (int i=0; i < msgUnits.length; i++) {
            msgUnits[i] = entries[i].getMsgUnit();
         }
      }
      this.msgQueue.removeRandom(entries);
      /*(currently only done in sync invocation)
      ArrayList defaultEntries = sendAsyncResponseEvent(entryList);
      if (defaultEntries.size() > 0) {
         MsgQueueEntry[] entries = (MsgQueueEntry[])defaultEntries.toArray(new MsgQueueEntry[defaultEntries.size()]);
         this.msgQueue.removeRandom(entries);
      }
      */
     
      if (postSendNotify)
         postSendNotification(entries);
     
      if (msgInterceptor != null) {
         msgInterceptor.postHandleNextMessages(this, msgUnits);
      }
     
      if (log.isLoggable(Level.FINE)) log.fine("Commit of successful sending of " +
            entries.length + " messages done, current queue size is " +
            this.msgQueue.getNumOfEntries() + " '" + entries[0].getLogId() + "'");
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.dispatch.plugins.I_MsgDispatchInterceptor

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.