[jboss-cvs] JBoss Messaging SVN: r3695 - in trunk/src/main/org/jboss/jms: client/impl and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Feb 9 09:20:36 EST 2008


Author: timfox
Date: 2008-02-09 09:20:32 -0500 (Sat, 09 Feb 2008)
New Revision: 3695

Added:
   trunk/src/main/org/jboss/jms/client/api/AcknowledgementHandler.java
Modified:
   trunk/src/main/org/jboss/jms/client/api/ClientProducer.java
   trunk/src/main/org/jboss/jms/client/impl/ClientProducerImpl.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
Log:
Reverted last change and added ack handler


Added: trunk/src/main/org/jboss/jms/client/api/AcknowledgementHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/api/AcknowledgementHandler.java	                        (rev 0)
+++ trunk/src/main/org/jboss/jms/client/api/AcknowledgementHandler.java	2008-02-09 14:20:32 UTC (rev 3695)
@@ -0,0 +1,34 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, JBoss Inc., and individual contributors as indicated
+   * by the @authors tag. See the copyright.txt in the distribution for a
+   * full listing of individual contributors.
+   *
+   * This is free software; you can redistribute it and/or modify it
+   * under the terms of the GNU Lesser General Public License as
+   * published by the Free Software Foundation; either version 2.1 of
+   * the License, or (at your option) any later version.
+   *
+   * This software is distributed in the hope that it will be useful,
+   * but WITHOUT ANY WARRANTY; without even the implied warranty of
+   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   * Lesser General Public License for more details.
+   *
+   * You should have received a copy of the GNU Lesser General Public
+   * License along with this software; if not, write to the Free
+   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+   */
+package org.jboss.jms.client.api;
+
+/**
+ * 
+ * A AcknowledgementHandler
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface AcknowledgementHandler
+{
+   void onAcknowledgement(long id);
+}

Modified: trunk/src/main/org/jboss/jms/client/api/ClientProducer.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/api/ClientProducer.java	2008-02-09 00:38:51 UTC (rev 3694)
+++ trunk/src/main/org/jboss/jms/client/api/ClientProducer.java	2008-02-09 14:20:32 UTC (rev 3695)
@@ -16,6 +16,10 @@
 public interface ClientProducer
 {        
    void send(String address, Message message) throws MessagingException;
+   
+   void registerAcknowledgementHandler(AcknowledgementHandler handler);
+   
+   void unregisterAcknowledgementHandler(AcknowledgementHandler handler);
       
    void close() throws MessagingException;
    

Modified: trunk/src/main/org/jboss/jms/client/impl/ClientProducerImpl.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/impl/ClientProducerImpl.java	2008-02-09 00:38:51 UTC (rev 3694)
+++ trunk/src/main/org/jboss/jms/client/impl/ClientProducerImpl.java	2008-02-09 14:20:32 UTC (rev 3695)
@@ -21,6 +21,7 @@
   */
 package org.jboss.jms.client.impl;
 
+import org.jboss.jms.client.api.AcknowledgementHandler;
 import org.jboss.jms.client.api.ClientProducer;
 import org.jboss.messaging.core.Message;
 import org.jboss.messaging.util.Logger;
@@ -68,6 +69,16 @@
       session.send(address, message);
    }
    
+   public void registerAcknowledgementHandler(AcknowledgementHandler handler)
+   {
+      // TODO      
+   }
+
+   public void unregisterAcknowledgementHandler(AcknowledgementHandler handler)
+   {
+      // TODO  
+   }
+
    public synchronized void close() throws MessagingException
    {
       if (closed)

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2008-02-09 00:38:51 UTC (rev 3694)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2008-02-09 14:20:32 UTC (rev 3695)
@@ -445,15 +445,7 @@
 
          for (Delivery del : deliveries)
          {
-            tx.addAcknowledgement(del.getReference());
-            
-            //We need this - since with auto commit acks, the last ack is considered delivered before it
-            //is acked - e.g. a JMS MessageListener where a RuntimException is thrown from onMessage
-            //in this case we want to ensure that the redelivered flag is set
-            if (autoCommitAcks)
-            {
-               del.getReference().incrementDeliveryCount();
-            }
+            tx.addAcknowledgement(del.getReference());           
          }
 
          deliveries.clear();




More information about the jboss-cvs-commits mailing list