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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 11 19:25:13 EST 2007


Author: timfox
Date: 2007-01-11 19:25:10 -0500 (Thu, 11 Jan 2007)
New Revision: 1965

Added:
   trunk/src/main/org/jboss/jms/server/bridge/ConnectionFactoryFactory.java
   trunk/src/main/org/jboss/jms/server/bridge/JNDIConnectionFactoryFactory.java
Modified:
   trunk/src/main/org/jboss/jms/server/bridge/Bridge.java
Log:
More bridge work


Modified: trunk/src/main/org/jboss/jms/server/bridge/Bridge.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/Bridge.java	2007-01-11 23:12:28 UTC (rev 1964)
+++ trunk/src/main/org/jboss/jms/server/bridge/Bridge.java	2007-01-12 00:25:10 UTC (rev 1965)
@@ -941,8 +941,6 @@
             
             if (trace) { log.trace(this + " rescheduled batchExpiryTime to " + batchExpiryTime); }
             
-            if (trace) { log.trace("max Batch Size is " + maxBatchSize); }
-            
             if (maxBatchSize != -1 && messages.size() >= maxBatchSize)
             {
                if (trace) { log.trace(this + " maxBatchSize has been reached so sending batch"); }

Added: trunk/src/main/org/jboss/jms/server/bridge/ConnectionFactoryFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/ConnectionFactoryFactory.java	2007-01-11 23:12:28 UTC (rev 1964)
+++ trunk/src/main/org/jboss/jms/server/bridge/ConnectionFactoryFactory.java	2007-01-12 00:25:10 UTC (rev 1965)
@@ -0,0 +1,38 @@
+/*
+ * 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.bridge;
+
+import javax.jms.ConnectionFactory;
+
+/**
+ * A ConnectionFactoryFactory
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public interface ConnectionFactoryFactory
+{
+   ConnectionFactory createConnectionFactory() throws Exception;
+}

Added: trunk/src/main/org/jboss/jms/server/bridge/JNDIConnectionFactoryFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/JNDIConnectionFactoryFactory.java	2007-01-11 23:12:28 UTC (rev 1964)
+++ trunk/src/main/org/jboss/jms/server/bridge/JNDIConnectionFactoryFactory.java	2007-01-12 00:25:10 UTC (rev 1965)
@@ -0,0 +1,73 @@
+/*
+ * 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.bridge;
+
+import java.util.Hashtable;
+
+import javax.jms.ConnectionFactory;
+import javax.naming.InitialContext;
+
+/**
+ * A JNDIConnectionFactoryFactory
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @version <tt>$Revision: 1.1 $</tt>
+ *
+ * $Id$
+ *
+ */
+public class JNDIConnectionFactoryFactory implements ConnectionFactoryFactory
+{
+   private Hashtable jndiProperties;
+   
+   private String lookup;
+   
+   public JNDIConnectionFactoryFactory(Hashtable jndiProperties, String lookup)
+   {
+      this.jndiProperties = jndiProperties;
+      
+      this.lookup = lookup;       
+   }
+
+   public ConnectionFactory createConnectionFactory() throws Exception
+   {
+      InitialContext ic = null;
+      
+      ConnectionFactory cf = null;
+      
+      try
+      {
+         ic = new InitialContext(jndiProperties);
+         
+         cf = (ConnectionFactory)ic.lookup(lookup);         
+      }
+      finally
+      {
+         if (ic != null)
+         {
+            ic.close();
+         }
+      }
+      return cf;      
+   }
+
+}




More information about the jboss-cvs-commits mailing list