[jboss-cvs] JBoss Messaging SVN: r3203 - trunk/src/main/org/jboss/jms/server/connectionfactory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 19 08:05:47 EDT 2007


Author: timfox
Date: 2007-10-19 08:05:47 -0400 (Fri, 19 Oct 2007)
New Revision: 3203

Modified:
   trunk/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
Log:
Tweak to sanity check


Modified: trunk/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java	2007-10-19 11:36:27 UTC (rev 3202)
+++ trunk/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactory.java	2007-10-19 12:05:47 UTC (rev 3203)
@@ -6,7 +6,6 @@
  */
 package org.jboss.jms.server.connectionfactory;
 
-import java.util.Iterator;
 import java.util.Map;
 
 import javax.management.ObjectName;
@@ -126,40 +125,7 @@
          {
             this.supportsFailover = false;
          }
-
-         connectionFactoryManager = serverPeer.getConnectionFactoryManager();
-         connectorManager = serverPeer.getConnectorManager();
-         connectionManager = serverPeer.getConnectionManager();
-
-         int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());
-
-         long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");
-
-         // if leasePeriod <= 0, disable pinging altogether
-
-         boolean enablePing = leasePeriod > 0;
          
-         if (refCount == 1 && enablePing)
-         {
-            // TODO Something is not quite right here, we can detect failure even if pinging is not
-            // enabled, for example if we try to send a callback to the client and sending the
-            // calback fails
-
-            // install the connection listener that listens for failed connections            
-            server.invoke(connectorObjectName, "addConnectionListener",
-                  new Object[] {connectionManager},
-                  new String[] {"org.jboss.remoting.ConnectionListener"});
-         }
-         
-         // We use the MBean service name to uniquely identify the connection factory
-         
-         connectionFactoryManager.
-            registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
-                                      locatorURI, enablePing, prefetchSize, slowConsumers,
-                                      defaultTempQueueFullSize, defaultTempQueuePageSize,                                      
-                                      defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
-                                      loadBalancingFactory, strictTck);
-      
          InvokerLocator locator = new InvokerLocator(locatorURI);
          
          String protocol = locator.getProtocol();
@@ -171,16 +137,8 @@
 	         //the AS they are running in - e.g. if they have forgotten to update it.
 	         //This can lead to subtle errors - therefore we do a sanity check by checking the existence of some properties
 	         //which should always be there
-	         Map params = locator.getParameters();
+	         Map params = locator.getParameters();	         
 	         
-	         Iterator iter= params.entrySet().iterator();
-	         log.info("Remoting connector params:");
-	         while (iter.hasNext())
-	         {
-	         	Map.Entry entry = (Map.Entry)iter.next();
-	         	log.info(entry.getKey() + "-->" + entry.getValue());
-	         }
-	         
 	         //The "compulsory" parameters
 	         boolean cont =
 	         	checkParam(params, "marshaller", "org.jboss.jms.wireformat.JMSWireFormat") &&	         		
@@ -191,12 +149,11 @@
 		         checkParam(params, "serverSocketClass", "org.jboss.jms.server.remoting.ServerSocketWrapper") &&
 		         checkParam(params, "numberOfCallRetries", "1") &&
 		         checkParam(params, "pingFrequency", "214748364") &&
-		         checkParam(params, "pingWindowFactor", "10") &&
-		         checkParam(params, "onewayThreadPool", "org.jboss.jms.server.remoting.DirectThreadPool");
+		         checkParam(params, "pingWindowFactor", "10");
 	         
 	         if (!cont)
 	         {
-	         	return;
+	         	throw new IllegalArgumentException("Failed to deploy connection factory since remoting configuration seems incorrect.");	         			                            
 	         }
 
 	         String val = (String)params.get("clientLeasePeriod");	  
@@ -219,7 +176,40 @@
 		         }
 	         }
          }
+
+         connectionFactoryManager = serverPeer.getConnectionFactoryManager();
+         connectorManager = serverPeer.getConnectorManager();
+         connectionManager = serverPeer.getConnectionManager();
+
+         int refCount = connectorManager.registerConnector(connectorObjectName.getCanonicalName());
+
+         long leasePeriod = (Long)JMXAccessor.getJMXAttributeOverSecurity(server, connectorObjectName, "LeasePeriod");
+
+         // if leasePeriod <= 0, disable pinging altogether
+
+         boolean enablePing = leasePeriod > 0;
          
+         if (refCount == 1 && enablePing)
+         {
+            // TODO Something is not quite right here, we can detect failure even if pinging is not
+            // enabled, for example if we try to send a callback to the client and sending the
+            // calback fails
+
+            // install the connection listener that listens for failed connections            
+            server.invoke(connectorObjectName, "addConnectionListener",
+                  new Object[] {connectionManager},
+                  new String[] {"org.jboss.remoting.ConnectionListener"});
+         }
+         
+         // We use the MBean service name to uniquely identify the connection factory
+         
+         connectionFactoryManager.
+            registerConnectionFactory(getServiceName().getCanonicalName(), clientID, jndiBindings,
+                                      locatorURI, enablePing, prefetchSize, slowConsumers,
+                                      defaultTempQueueFullSize, defaultTempQueuePageSize,                                      
+                                      defaultTempQueueDownCacheSize, dupsOKBatchSize, supportsFailover, supportsLoadBalancing,
+                                      loadBalancingFactory, strictTck);               
+         
          String info = "Connector " + locator.getProtocol() + "://" +
             locator.getHost() + ":" + locator.getPort();
                  




More information about the jboss-cvs-commits mailing list