Examples of AbstractMessage


Examples of net.timewalker.ffmq3.common.message.AbstractMessage

      throw new NoSuchElementException();
   
    try
    {
      checkNotClosed();
      AbstractMessage msg = fetchNext();
      if (msg != null)
      {
        nextMessage = null; // Consume fetched message
        AbstractMessage msgCopy = MessageTools.duplicate(msg);
        msgCopy.ensureDeserializationLevel(MessageSerializationLevel.FULL);
        return msgCopy;
      }
     
      throw new NoSuchElementException();
    }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

             
              MessageStore store = transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT ? persistentStore : volatileStore;
              int handle = transactionItem.getHandle();
             
              // Retrieve message content
               AbstractMessage msg = store.retrieve(handle);
              
               // Update redelivered flag both in memory and message store
               msg.setJMSRedelivered(true);
               handle = store.replace(handle, msg);
              
              if (redeliveryDelay > 0)
              {
                  // Keep the message locked so it cannot be re-consumed immediately                 
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

      if (closed)
        return null;
     
      this.lastActivity = System.currentTimeMillis();
     
      AbstractMessage msg = null;
     
        // Search in volatile store first
        if (volatileStore != null)
        {
            msg = getFromStore(localSession, volatileStore, transactionSet, selector);
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

      cursor.reset();
     
      // Search in volatile store first
        if (volatileStore != null)
        {
            AbstractMessage msg = browseStore(volatileStore, cursor, selector);
            if (msg != null)
            {
              cursor.move();
                return msg;
            }
        }
       
        // Then in persistent store
        if (persistentStore != null)
        {
          AbstractMessage msg = browseStore(persistentStore, cursor, selector);
          if (msg != null)
            {
              cursor.move();
                return msg;
            }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

            {
                // Skip locked messages
                if (!store.isLocked(current))
                {
                    // Retrieve the message
                    AbstractMessage msg = store.retrieve(current);
                   
                    // Check expiration
                    if (msg.getJMSExpiration() > 0 && msg.getJMSExpiration() < now)
                    {
                      int handleToDelete = current;
                      current = store.next(current);
                      store.delete(handleToDelete);
                      continue;
                    }
                   
                    // Check selector
                    if (selector == null)
                    {
                        return msg;
                    }
                    else
                    {
                      msg.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                      if (selector.matches(msg))
                        return msg;
                    }
                }
               
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

            {
                // Skip locked messages
                if (!store.isLocked(current))
                {
                    // Retrieve the message
                    AbstractMessage msg = store.retrieve(current);
  
                    // Check expiration
                    if (msg.getJMSExpiration() > 0 && msg.getJMSExpiration() < lastActivity)
                    {
                      int handleToDelete = current;
                      current = store.next(current);
                      store.delete(handleToDelete);
                      continue;
                    }
                   
                    // Check selector
                    boolean matchesSelector;
                    if (selector != null)
                    {
                      msg.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                      matchesSelector = selector.matches(msg);
                    }
                    else
                      matchesSelector = true;
                   
                    if (matchesSelector)
                    {
                        store.lock(current);
                       
                        if (traceEnabled)
                          log.trace(localSession+" LOCKED "+msg.getJMSMessageID());
                       
                        transactionSet.add(current,
                                       msg.getJMSMessageID(),
                                       store.getDeliveryMode(),
                                       this);
                        receivedFromQueueCount++;
                        return msg;
                    }
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

                // Skip locked messages
                if (!store.isLocked(current))
                {
                  if (selector != null)
                  {
                    AbstractMessage msg = store.retrieve(current);
                    msg.ensureDeserializationLevel(MessageSerializationLevel.ALL_HEADERS);
                        if (selector.matches(msg))
                          store.delete(current);
                  }
                  else
                    store.delete(current);
View Full Code Here

Examples of net.timewalker.ffmq3.common.message.AbstractMessage

                    log.debug(this+" - COMMIT [PUT:QUEUE] "+pendingQueuePuts.size()+" message(s)");
               
              // Simpler (and most common) use case
              if (pendingQueuePuts.size() == -1)
              {
                AbstractMessage message = (AbstractMessage)pendingQueuePuts.get(0);
                putImmediately(message,committables);               
                producedCount++;
              }
              else
              {
                // A two phase injection is required because one destination may throw
                // an exception while messages have already been added to queues (queue full for example)
               
                // Step 1 - Put messages in locked state
                MessageLockSet locks = new MessageLockSet(pendingQueuePuts.size());
                try
                {
                  for (int i = 0; i < pendingQueuePuts.size(); i++)
                  {
                    AbstractMessage message = (AbstractMessage)pendingQueuePuts.get(i);
                    putLocked(message, locks, committables);
                    producedCount++;
                }
                }
                catch (JMSException e)
                {
                  // Remove locked messages
                  for (int i = 0; i < locks.size(); i++)
              {
                MessageLock item = locks.get(i);
                item.getDestination().removeLocked(item);
              }
                 
                  throw e;
                }
               
                // Step 2 - Unlock & deliver messages
                for (int i = 0; i < locks.size(); i++)
            {
              MessageLock item = locks.get(i);
              item.getDestination().unlockAndDeliver(item);
            }
              }
             
              pendingQueuePuts.clear();
            }
        }
       
        // Topic messages
        synchronized (pendingTopicPuts)
        {
            if (!pendingTopicPuts.isEmpty())
            {
              if (debugEnabled)
                    log.debug(this+" - COMMIT [PUT:TOPIC] "+pendingTopicPuts.size()+" message(s)");
               
              for (int i = 0; i < pendingTopicPuts.size(); i++)
          {
                AbstractMessage message = (AbstractMessage)pendingTopicPuts.get(i);
                  putImmediately(message,committables);               
                  producedCount++; 
          }
             
              pendingTopicPuts.clear();
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.AbstractMessage

     * Tests to see the same object returns true.
     */
    @Test
    public void testEqualsSameObj()
    {
        AbstractMessage msg;
        msg = new AbstractMessage( 5, MessageTypeEnum.BIND_REQUEST )
        {
            private static final long serialVersionUID = 1L;
        };
        assertTrue( msg.equals( msg ) );
    }
View Full Code Here

Examples of org.apache.directory.api.ldap.model.message.AbstractMessage

     * Tests to see the same exact copy returns true.
     */
    @Test
    public void testEqualsExactCopy()
    {
        AbstractMessage msg0;
        AbstractMessage msg1;
        msg0 = new AbstractMessage( 5, MessageTypeEnum.BIND_REQUEST )
        {
            private static final long serialVersionUID = 1L;
        };
        msg1 = new AbstractMessage( 5, MessageTypeEnum.BIND_REQUEST )
        {
            private static final long serialVersionUID = 1L;
        };
        assertTrue( msg0.equals( msg1 ) );
        assertTrue( msg1.equals( msg0 ) );
    }
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.