[jboss-cvs] JBoss Messaging SVN: r1925 - branches/Branch_Cleberts_Third_Failover/src/main/org/jboss/jms/client/container

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 8 23:26:54 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-01-08 23:26:53 -0500 (Mon, 08 Jan 2007)
New Revision: 1925

Modified:
   branches/Branch_Cleberts_Third_Failover/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
Log:
'being on the same page' kind of thing

Modified: branches/Branch_Cleberts_Third_Failover/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java
===================================================================
--- branches/Branch_Cleberts_Third_Failover/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java	2007-01-09 03:00:44 UTC (rev 1924)
+++ branches/Branch_Cleberts_Third_Failover/src/main/org/jboss/jms/client/container/FailoverValveInterceptor.java	2007-01-09 04:26:53 UTC (rev 1925)
@@ -8,7 +8,6 @@
 
 import org.jboss.aop.advice.Interceptor;
 import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
 import org.jboss.logging.Logger;
 import org.jboss.jms.client.delegate.DelegateSupport;
 import org.jboss.jms.client.state.HierarchicalState;
@@ -17,9 +16,6 @@
 import org.jboss.jms.client.remoting.JMSRemotingConnection;
 import org.jboss.jms.delegate.ConnectionDelegate;
 import org.jboss.remoting.CannotConnectException;
-import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.Sync;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -53,7 +49,6 @@
    // Attributes -----------------------------------------------------------------------------------
 
    private DelegateSupport delegate;
-   private HierarchicalState state;
    private ConnectionState connectionState;
    private volatile boolean valveOpen;
 
@@ -91,11 +86,11 @@
       if (delegate == null)
       {
          delegate = (DelegateSupport)invocation.getTargetObject();
-         state = delegate.getState();
 
-         // we need to navigate until we get to ConnectionState as we need to extract the valve instance from there
-         HierarchicalState hierarchical = state;
-         while (hierarchical!=null && !(hierarchical instanceof ConnectionState))
+         // we need to navigate until we get to ConnectionState as we need to extract the valve
+         // instance from there
+         HierarchicalState hierarchical = delegate.getState();
+         while (hierarchical != null && !(hierarchical instanceof ConnectionState))
          {
             hierarchical = hierarchical.getParent();
          }
@@ -109,16 +104,14 @@
          return invocation.invokeNext();
       }
 
-
-
-      String methodName = ((MethodInvocation)invocation).getMethod().getName();
-
       JMSRemotingConnection remotingConnection = null;
+
       try
       {
          valve.enter();
-         // it's important to only retrieve the remotingConnection while inside the Valve, as we guarantee
-         // that no failover has happened yet
+
+         // it's important to only retrieve the remotingConnection while inside the Valve, as we
+         // guarantee that no failover has happened yet
          remotingConnection = connectionState.getRemotingConnection();
          return invocation.invokeNext();
       }
@@ -127,7 +120,6 @@
          log.warn("We got a CannotConnectionException and we are trying a failover", e);
          ((ConnectionDelegate)connectionState.getDelegate()).performFailover(remotingConnection);
          return invocation.invokeNext();
-
       }
       catch (IOException e)
       {




More information about the jboss-cvs-commits mailing list