[jboss-cvs] JBoss Messaging SVN: r2476 - in trunk: src/main/org/jboss/jms/server/endpoint and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 27 16:38:43 EST 2007


Author: timfox
Date: 2007-02-27 16:38:43 -0500 (Tue, 27 Feb 2007)
New Revision: 2476

Added:
   trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java
Modified:
   trunk/src/etc/prepare-aop.xml
   trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java
   trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
   trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryCreateConnectionDelegateRequest.java
   trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
   trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
   trunk/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java
Log:
Fixed ClusteredConnectionFactoryTest


Modified: trunk/src/etc/prepare-aop.xml
===================================================================
--- trunk/src/etc/prepare-aop.xml	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/src/etc/prepare-aop.xml	2007-02-27 21:38:43 UTC (rev 2476)
@@ -16,7 +16,7 @@
  
   <!-- Prepare the server delegate classes - these provide the server side advice stack -->
   
-  <prepare expr="execution(* org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised->$implementing{org.jboss.jms.server.endpoint.ConnectionFactoryEndpoint}(..))"/>
+  <prepare expr="execution(* org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised->$implementing{org.jboss.jms.server.endpoint.ConnectionFactoryInternalEndpoint}(..))"/>
   <prepare expr="execution(* org.jboss.jms.server.endpoint.advised.ConnectionAdvised->$implementing{org.jboss.jms.server.endpoint.ConnectionEndpoint}(..))"/>
   <prepare expr="execution(* org.jboss.jms.server.endpoint.advised.SessionAdvised->$implementing{org.jboss.jms.server.endpoint.SessionEndpoint}(..))"/> 
   <prepare expr="execution(* org.jboss.jms.server.endpoint.advised.ConsumerAdvised->$implementing{org.jboss.jms.server.endpoint.ConsumerEndpoint}(..))"/>

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryEndpoint.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -44,8 +44,6 @@
                                                    int failedNodeID)
       throws JMSException;
    
-   //IDBlock getIdBlock(int size) throws JMSException;
-   
-   byte[] getClientAOPStack() throws JMSException;
+   byte[] getClientAOPStack() throws JMSException;     
 }
 

Added: trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java	                        (rev 0)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ConnectionFactoryInternalEndpoint.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -0,0 +1,49 @@
+/*
+ * 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.server.endpoint;
+
+import javax.jms.JMSException;
+
+import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
+
+/**
+ * A ConnectionFactoryInternalEndpoint
+ * 
+ * The interface only exists so the connection factory requests can call through the AOP stack
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public interface ConnectionFactoryInternalEndpoint extends ConnectionFactoryEndpoint
+{
+   CreateConnectionResult createConnectionDelegate(String username,
+                                                   String password,
+                                                   int failedNodeID,
+                                                   String remotingSessionID,
+                                                   String clientVMID,
+                                                   byte versionToUse,
+                                                   ServerInvokerCallbackHandler callbackHandler)
+                                       throws JMSException;
+}

Modified: trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/src/main/org/jboss/jms/server/endpoint/advised/ConnectionFactoryAdvised.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -24,8 +24,10 @@
 import javax.jms.JMSException;
 
 import org.jboss.jms.server.endpoint.ConnectionFactoryEndpoint;
+import org.jboss.jms.server.endpoint.ConnectionFactoryInternalEndpoint;
 import org.jboss.jms.server.endpoint.CreateConnectionResult;
-import org.jboss.messaging.core.plugin.IDBlock;
+import org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint;
+import org.jboss.remoting.callback.ServerInvokerCallbackHandler;
 
 /**
  *
@@ -35,7 +37,7 @@
  *
  * ConnectionFactoryAdvised.java,v 1.3 2006/03/01 22:56:51 ovidiu Exp
  */
-public class ConnectionFactoryAdvised extends AdvisedSupport implements ConnectionFactoryEndpoint
+public class ConnectionFactoryAdvised extends AdvisedSupport implements ConnectionFactoryInternalEndpoint
 {
    // Constants -----------------------------------------------------
 
@@ -70,6 +72,21 @@
    {
       return endpoint.getClientAOPStack();
    }
+   
+   // ConnectionFactoryInternalEndpoint implementation -----------------------
+   public CreateConnectionResult createConnectionDelegate(String username,
+                                                          String password,
+                                                          int failedNodeID,
+                                                          String remotingSessionID,
+                                                          String clientVMID,
+                                                          byte versionToUse,
+                                                          ServerInvokerCallbackHandler callbackHandler)
+      throws JMSException
+   {
+      return ((ServerConnectionFactoryEndpoint)endpoint).createConnectionDelegate(username, password, failedNodeID,
+                                                      remotingSessionID, clientVMID,
+                                                      versionToUse, callbackHandler);
+   }
 
    // AdvisedSupport override ---------------------------------------
 

Modified: trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryCreateConnectionDelegateRequest.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryCreateConnectionDelegateRequest.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/src/main/org/jboss/jms/wireformat/ConnectionFactoryCreateConnectionDelegateRequest.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -101,11 +101,8 @@
          throw new IllegalStateException("Cannot find object in dispatcher with id " + objectId);
       }
       
-      ServerConnectionFactoryEndpoint endpoint =
-         (ServerConnectionFactoryEndpoint)advised.getEndpoint();
-                     
       CreateConnectionResult del = 
-         endpoint.createConnectionDelegate(username, password, failedNodeId,
+         advised.createConnectionDelegate(username, password, failedNodeId,
                                            remotingSessionId, clientVMId, version,
                                            callbackHandler);
       

Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -1572,8 +1572,7 @@
 
          // The state will give us the clustered bindings - but not the non clustered ones - so we load these
          // explicitly
-         log.info(" not first member of group, so waiting for state to arrive....");
-         
+
          synchronized (setStateLock)
          {
             //TODO we should implement a timeout on this
@@ -1583,10 +1582,8 @@
             }
          }
          
-         log.info("loading non clustered bindings from db");
          super.loadBindings(true);
-         
-         
+                  
          if (trace) { log.trace(this + " received state"); }
       }
    }

Modified: trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/tests/src/org/jboss/test/messaging/jms/clustering/ClusteredConnectionFactoryTest.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -22,13 +22,15 @@
 
 package org.jboss.test.messaging.jms.clustering;
 
+import java.lang.reflect.Field;
+
 import javax.jms.Connection;
+
+import org.jboss.jms.client.ClientAOPStackLoader;
 import org.jboss.jms.client.JBossConnection;
-import org.jboss.jms.client.ClientAOPStackLoader;
+import org.jboss.test.messaging.jms.clustering.base.ClusteringTestBase;
 import org.jboss.test.messaging.tools.ServerManagement;
 import org.jboss.test.messaging.tools.aop.PoisonInterceptor;
-import org.jboss.test.messaging.jms.clustering.base.ClusteringTestBase;
-import java.lang.reflect.Field;
 
 /**
  * TODO: Is it possible to move tests I added on ClusteredConnectionFactoryGraveyardTest?
@@ -125,7 +127,7 @@
       {
 
          // Poison each server with a different pointcut crash
-         ServerManagement.poisonTheServer(1, PoisonInterceptor.CF_GET_ID_BLOCK);
+         ServerManagement.poisonTheServer(1, PoisonInterceptor.CF_CREATE_CONNECTION);
 
          conn = cf.createConnection();
          assertEquals(0, ((JBossConnection)conn).getServerID());
@@ -133,6 +135,7 @@
          conn = null;
 
          // this should break on server1
+         log.info("creating connection on server 1");
          conn = cf.createConnection();
 
          assertEquals(2, ((JBossConnection)conn).getServerID());

Modified: trunk/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java	2007-02-27 21:05:50 UTC (rev 2475)
+++ trunk/tests/src/org/jboss/test/messaging/tools/aop/PoisonInterceptor.java	2007-02-27 21:38:43 UTC (rev 2476)
@@ -56,7 +56,7 @@
    
    public static final int LONG_SEND = 8;
 
-   public static final int CF_GET_ID_BLOCK = 9;
+   public static final int CF_CREATE_CONNECTION= 9;
 
    public static final int CF_GET_CLIENT_AOP_STACK = 10;
    // Static ---------------------------------------------------------------------------------------
@@ -201,8 +201,8 @@
          }
       }
       else if (target instanceof ConnectionFactoryAdvised &&
-               (type == CF_GET_ID_BLOCK && "getIdBlock".equals(methodName) ||
-                type == CF_GET_CLIENT_AOP_STACK && "getClientAOPStack".equals(methodName)))
+               (type == CF_GET_CLIENT_AOP_STACK && "getClientAOPStack".equals(methodName))
+               || (type == CF_CREATE_CONNECTION && "createConnectionDelegate".equals(methodName)))
       {
          crash(target);
       }




More information about the jboss-cvs-commits mailing list