[seam-commits] Seam SVN: r9107 - trunk/src/remoting/org/jboss/seam/remoting/messaging.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Sep 22 18:51:54 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-09-22 18:51:54 -0400 (Mon, 22 Sep 2008)
New Revision: 9107

Removed:
   trunk/src/remoting/org/jboss/seam/remoting/messaging/JBossConnectionProvider.java
   trunk/src/remoting/org/jboss/seam/remoting/messaging/JMSConnectionProvider.java
Modified:
   trunk/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java
Log:
delegate to TopicConnection factory for JMS connections

Deleted: trunk/src/remoting/org/jboss/seam/remoting/messaging/JBossConnectionProvider.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/messaging/JBossConnectionProvider.java	2008-09-22 22:45:52 UTC (rev 9106)
+++ trunk/src/remoting/org/jboss/seam/remoting/messaging/JBossConnectionProvider.java	2008-09-22 22:51:54 UTC (rev 9107)
@@ -1,22 +0,0 @@
-package org.jboss.seam.remoting.messaging;
-
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.naming.InitialContext;
-
-/**
- *
- * @author Shane Bryzak
- */
-public class JBossConnectionProvider implements JMSConnectionProvider
-{
-  private static final String FACTORY_JNDI_NAME = "UIL2ConnectionFactory";
-
-  public TopicConnection createConnection()
-    throws Exception
-  {
-    InitialContext ctx = new InitialContext();
-    TopicConnectionFactory f = (TopicConnectionFactory) ctx.lookup(FACTORY_JNDI_NAME);
-    return f.createTopicConnection();
-  }
-}

Deleted: trunk/src/remoting/org/jboss/seam/remoting/messaging/JMSConnectionProvider.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/messaging/JMSConnectionProvider.java	2008-09-22 22:45:52 UTC (rev 9106)
+++ trunk/src/remoting/org/jboss/seam/remoting/messaging/JMSConnectionProvider.java	2008-09-22 22:51:54 UTC (rev 9107)
@@ -1,11 +0,0 @@
-package org.jboss.seam.remoting.messaging;
-
-import javax.jms.TopicConnection;
-
-/**
- *
- * @author Shane Bryzak
- */
-public interface JMSConnectionProvider {
-  public TopicConnection createConnection() throws Exception;
-}

Modified: trunk/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java
===================================================================
--- trunk/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java	2008-09-22 22:45:52 UTC (rev 9106)
+++ trunk/src/remoting/org/jboss/seam/remoting/messaging/SubscriptionRegistry.java	2008-09-22 22:51:54 UTC (rev 9107)
@@ -22,7 +22,6 @@
 import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
-import org.jboss.seam.util.Reflections;
 
 /**
  *
@@ -34,9 +33,6 @@
 @Install(value = false, precedence=BUILT_IN)
 public class SubscriptionRegistry
 {
-  private static final String DEFAULT_CONNECTION_PROVIDER =
-    "org.jboss.seam.remoting.messaging.JBossConnectionProvider";
-
   public static final String CONTEXT_USER_TOKENS =
       "org.jboss.seam.remoting.messaging.SubscriptionRegistry.userTokens";
 
@@ -96,13 +92,8 @@
       {
         if (topicConnection == null)
         {
-          String providerName = connectionProvider != null ?
-                                    connectionProvider : DEFAULT_CONNECTION_PROVIDER;
-          try {
-            Class providerClass = Reflections.classForName(providerName);
-            JMSConnectionProvider provider = (JMSConnectionProvider) providerClass.newInstance();
-            topicConnection = provider.createConnection();
-
+            topicConnection = org.jboss.seam.jms.TopicConnection.instance();
+            
             topicConnection.setExceptionListener(new ExceptionListener() {
               public void onException(JMSException ex)
               {
@@ -110,19 +101,6 @@
               }
             });
             topicConnection.start();
-          }
-          catch (ClassNotFoundException ex)
-          {
-            log.error(String.format("Topic connection provider class [%s] not found",
-                                    providerName));
-            throw ex;
-          }
-          catch (InstantiationException ex)
-          {
-            log.error(String.format("Failed to create connection provider [%s]",
-                                    providerName));
-            throw ex;
-          }
         }
       }
     }




More information about the seam-commits mailing list