[jboss-cvs] JBoss Messaging SVN: r3231 - in trunk/src/main/org/jboss: messaging/core/impl/postoffice and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Oct 21 03:50:26 EDT 2007


Author: timfox
Date: 2007-10-21 03:50:25 -0400 (Sun, 21 Oct 2007)
New Revision: 3231

Modified:
   trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
   trunk/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
Log:
Re-reverted cleberts fix (damn svn)


Modified: trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2007-10-20 18:17:30 UTC (rev 3230)
+++ trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2007-10-21 07:50:25 UTC (rev 3231)
@@ -127,43 +127,30 @@
    public Object handleClosing(Invocation invocation) throws Throwable
    {
       ConsumerState consumerState = getState(invocation);
-      try
-      {
+      
+      // We make sure closing is called on the ServerConsumerEndpoint.
+      // This returns us the last delivery id sent
 
-         // We make sure closing is called on the ServerConsumerEndpoint.
-         // This returns us the last delivery id sent
+      Long l  = (Long)invocation.invokeNext();
 
-         Long l  = (Long)invocation.invokeNext();
+      long lastDeliveryId = l.longValue();
 
-         long lastDeliveryId = l.longValue();
+      // First we call close on the ClientConsumer which waits for onMessage invocations
+      // to complete and the last delivery to arrive
+      consumerState.getClientConsumer().close(lastDeliveryId);
 
-         // First we call close on the ClientConsumer which waits for onMessage invocations
-         // to complete and the last delivery to arrive
-         consumerState.getClientConsumer().close(lastDeliveryId);
+      SessionState sessionState = (SessionState)consumerState.getParent();
+      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
 
-         SessionState sessionState = (SessionState)consumerState.getParent();
-         ConnectionState connectionState = (ConnectionState)sessionState.getParent();
+      sessionState.removeCallbackHandler(consumerState.getClientConsumer());
 
-         sessionState.removeCallbackHandler(consumerState.getClientConsumer());
+      CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();
+      cm.unregisterHandler(consumerState.getConsumerID());
 
-         CallbackManager cm = connectionState.getRemotingConnection().getCallbackManager();
-         cm.unregisterHandler(consumerState.getConsumerID());
+      //And then we cancel any messages still in the message callback handler buffer
+      consumerState.getClientConsumer().cancelBuffer();
 
-         //And then we cancel any messages still in the message callback handler buffer
-         consumerState.getClientConsumer().cancelBuffer();
-
-         return l;
-      }
-      finally
-      {
-         // If this method fails before the call to clientConsumer.close,
-         // we need to ensure the method will close the consumer, otherwise the server
-         // would hang during a shutdown
-         if (!consumerState.getClientConsumer().isClosed())
-         {
-            consumerState.getClientConsumer().close(-1);
-         }
-      }
+      return l;
    }
    
    public Object handleReceive(Invocation invocation) throws Throwable

Modified: trunk/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2007-10-20 18:17:30 UTC (rev 3230)
+++ trunk/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java	2007-10-21 07:50:25 UTC (rev 3231)
@@ -225,8 +225,6 @@
    //overwhelming JGroups
    private ClearableSemaphore replicateSemaphore;
       
-   private int maxConcurrentReplications;
-   
    // Constructors ---------------------------------------------------------------------------------
 
    /*
@@ -2778,10 +2776,10 @@
    {   	   	
    	//The failover node has changed - we need to move our replicated deliveries
    	
-   	if (trace) { log.trace("Failover node has changed from " + oldFailoverNodeID + " to " + failoverNodeID); }
+   	if (trace) { log.trace("Failover node has changed from " + oldFailoverNodeID + " to " + failoverNodeID); }   	  	
    	
-   	replicateSemaphore.disable();
-   	   	
+   	replicateSemaphore.disable();	 
+   	
    	if (!firstNode)
    	{	   	
 	   	//If the old node still exists we need to send a message to remove any replicated deliveries
@@ -2797,7 +2795,7 @@
 	   		groupMember.unicastData(request, info.getDataChannelAddress());
 	   		
 	   		if (trace) { log.trace("Sent AckAllReplicatedDeliveriesMessage"); }
-	   	}
+	   	}  	 
    	}
    	
    	//Now send the deliveries to the new node - we only do this if the new failover node came about by




More information about the jboss-cvs-commits mailing list