Package org.jboss.messaging.core.contract

Examples of org.jboss.messaging.core.contract.Message


                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = pair.ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
                        if (psInsertMessage == null)
                        {
                           psInsertMessage = conn
                                 .prepareStatement(getSQLStatement("INSERT_MESSAGE"));
                        }

                        storeMessage(m, psInsertMessage, true);
                        rows = psInsertMessage.executeUpdate();

                        if (trace)
                        {
                           log.trace("Inserted " + rows + " rows");
                        }

                        m.setPersisted(true);

                        messagesStored.add(m);

                        //We only cache the first id in a tx - this is enough to determine if the tx succeeded
                        if (first && m instanceof JBossMessage)
View Full Code Here


         {
            if(messagesStored != null)
            {
               for (Iterator i = messagesStored.iterator(); i.hasNext();)
               {
                  Message msg = (Message) i.next();

                  msg.setPersisted(false);
               }
            }
         }
View Full Code Here

      ids.add(msgId);
      List msgs = persistenceManager.getMessages(ids);
      Iterator msgIter = msgs.iterator();
      while (msgIter.hasNext())
      {
         Message m = (Message)msgIter.next();
         buffer.append("<tr>");
         buffer.append("<td>" + m.getMessageID() + "</td>");
         buffer.append("<td>" + m.getExpiration() + "</td>");
         buffer.append("<td>" + new Date(m.getTimestamp()) + "</td>");
         buffer.append("<td>" + m.getPriority() + "</td>");
         buffer.append("<td>" + m.getType() + "</td>");
         buffer.append("<td>" + m.getHeaders() + "</td>");
         buffer.append("<td>" + m.getPayload() + "</td>");
         buffer.append("<td>" + m.getPayload().getClass().getName() + "</td>");
         buffer.append("</tr>");
      }
     
      return buffer.toString();
   }
View Full Code Here

          
           while (iter.hasNext())
           {
             MessageReference ref = (MessageReference)iter.next();
            
             Message message = ref.getMessage();
            
             String sessionID = (String)toRecover.remove(new Long(message.getMessageID()));
            
             if (sessionID != null)
             {
               if (trace) { log.trace("Added ref " + ref + " to recovery map"); }
              
               RecoveryEntry re = new RecoveryEntry();
               re.ref = ref;
               re.sessionID = sessionID;
              
               recoveryMap.put(new Long(message.getMessageID()), re);
              
               deliveringCount.increment(ref.getMessage());
              
               iter.remove();
              
View Full Code Here

          
           while (iter.hasNext())
           {
             MessageReference ref = (MessageReference)iter.next();
            
             Message message = ref.getMessage();
            
             String sessionID = (String)toRecover.remove(new Long(message.getMessageID()));
            
             if (sessionID != null)
             {
               if (trace) { log.trace("Added ref " + ref + " to recovery map"); }
              
               RecoveryEntry re = new RecoveryEntry();
               re.ref = ref;
               re.sessionID = sessionID;
              
               recoveryMap.put(new Long(message.getMessageID()), re);
              
               deliveringCount.increment();
              
               iter.remove();
              
View Full Code Here

                        byte[] payload = getBytes(rs, 7);

                        byte type = rs.getByte(8);

                        Message m = MessageFactory.createMessage(messageId,
                              reliable, expiration, timestamp, priority,
                              headers, payload, type);
                        msgs.add(m);
                     }
View Full Code Here

                  {
                     log.trace("Inserted " + rows + " rows");
                  }
                 
                  // Maybe we need to persist the message itself
                  Message m = ref.getMessage();

                  rows = storeMessage(m, psInsertMessage, psUpdateMessage);

                  if (trace)
                  {
View Full Code Here

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
                        if (psInsertMessage == null)
                        {
                           psInsertMessage = conn
                                 .prepareStatement(getSQLStatement("INSERT_MESSAGE"));
                        }

                        // First time so add message
                        // And in case of clustered queues/topics, the message
                        // could possibly be already persisted on the different
                        // node
                        // so we persist also using the Conditional Update
                        if (trace)
                        {
                           log
                                 .trace("Message does not already exist so inserting it");
                        }
                        storeMessage(m, psInsertMessage, true);
                        rows = psInsertMessage.executeUpdate();
                        if (trace)
                        {
                           log.trace("Inserted " + rows + " rows");
                        }

                        m.setPersisted(true);

                        messagesStored.add(m);

                        //We only cache the first id in a tx - this is enough to determine if the tx succeeded
                        if (first && m instanceof JBossMessage)
View Full Code Here

         {
            if(messagesStored != null)
            {
               for (Iterator i = messagesStored.iterator(); i.hasNext();)
               {
                  Message msg = (Message) i.next();

                  msg.setPersisted(false);
               }
            }
         }
View Full Code Here

                  if (trace)
                  {
                     log.trace("Inserted " + rows + " rows");
                  }

                  Message m = pair.ref.getMessage();

                  synchronized (m)
                  {
                     if (!m.isPersisted())
                     {
                        if (psInsertMessage == null)
                        {
                           psInsertMessage = conn
                                 .prepareStatement(getSQLStatement("INSERT_MESSAGE"));
                        }

                        storeMessage(m, psInsertMessage, true);
                        rows = psInsertMessage.executeUpdate();

                        if (trace)
                        {
                           log.trace("Inserted " + rows + " rows");
                        }

                        m.setPersisted(true);

                        messagesStored.add(m);

                        //We only cache the first id in a tx - this is enough to determine if the tx succeeded
                        if (first && m instanceof JBossMessage)
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.contract.Message

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.