Author: jgomes
Date: Tue Mar  9 00:54:59 2010
New Revision: 920599

URL: http://svn.apache.org/viewvc?rev=920599&view=rev
Log:
Fix error in creating connection factory.

Modified:
    
activemq/activemq-dotnet/Apache.NMS.EMS/tags/1.2.0-RC1/src/main/csharp/ConnectionFactory.cs
    
activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs

Modified: 
activemq/activemq-dotnet/Apache.NMS.EMS/tags/1.2.0-RC1/src/main/csharp/ConnectionFactory.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/tags/1.2.0-RC1/src/main/csharp/ConnectionFactory.cs?rev=920599&r1=920598&r2=920599&view=diff
==============================================================================
--- 
activemq/activemq-dotnet/Apache.NMS.EMS/tags/1.2.0-RC1/src/main/csharp/ConnectionFactory.cs
 (original)
+++ 
activemq/activemq-dotnet/Apache.NMS.EMS/tags/1.2.0-RC1/src/main/csharp/ConnectionFactory.cs
 Tue Mar  9 00:54:59 2010
@@ -48,55 +48,37 @@
                        VerifyConnectionFactory();
                }
 
-               public ConnectionFactory(Uri uriProvider)
-                       : this(uriProvider.AbsolutePath)
+               public ConnectionFactory(Uri serverUrl)
+                       : this(serverUrl, string.Empty)
                {
                }
 
-               public ConnectionFactory(Uri uriProvider, string clientId)
-                       : this(uriProvider.AbsolutePath, clientId)
+               public ConnectionFactory(Uri serverUrl, string clientId)
+                       : this(serverUrl, clientId, null)
                {
                }
 
                public ConnectionFactory(string serverUrl)
+                       : this(new Uri(serverUrl))
                {
-                       try
-                       {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl);
-                               this.brokerUri = new Uri(serverUrl);
-                       }
-                       catch(Exception ex)
-                       {
-                               Apache.NMS.Tracer.DebugFormat("Exception 
instantiating TIBCO.EMS.ConnectionFactory: {0}", ex.Message);
-                               ExceptionUtil.WrapAndThrowNMSException(ex);
-                       }
-
-                       VerifyConnectionFactory();
                }
 
                public ConnectionFactory(string serverUrl, string clientId)
+                       : this(new Uri(serverUrl), clientId)
                {
-                       try
-                       {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl, clientId);
-                               this.brokerUri = new Uri(serverUrl);
-                               this.clientId = clientId;
-                       }
-                       catch(Exception ex)
-                       {
-                               Apache.NMS.Tracer.DebugFormat("Exception 
instantiating TIBCO.EMS.ConnectionFactory: {0}", ex.Message);
-                               ExceptionUtil.WrapAndThrowNMSException(ex);
-                       }
-
-                       VerifyConnectionFactory();
                }
 
                public ConnectionFactory(string serverUrl, string clientId, 
Hashtable properties)
+                       : this(new Uri(serverUrl), clientId, properties)
+               {
+               }
+
+               public ConnectionFactory(Uri serverUrl, string clientId, 
Hashtable properties)
                {
                        try
                        {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl, clientId, properties);
-                               this.brokerUri = new Uri(serverUrl);
+                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl.AbsolutePath, clientId, properties);
+                               this.brokerUri = serverUrl;
                                this.clientId = clientId;
                                this.properties = properties;
                        }

Modified: 
activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs
URL: 
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs?rev=920599&r1=920598&r2=920599&view=diff
==============================================================================
--- 
activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs
 (original)
+++ 
activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/ConnectionFactory.cs
 Tue Mar  9 00:54:59 2010
@@ -48,55 +48,37 @@
                        VerifyConnectionFactory();
                }
 
-               public ConnectionFactory(Uri uriProvider)
-                       : this(uriProvider.AbsolutePath)
+               public ConnectionFactory(Uri serverUrl)
+                       : this(serverUrl, string.Empty)
                {
                }
 
-               public ConnectionFactory(Uri uriProvider, string clientId)
-                       : this(uriProvider.AbsolutePath, clientId)
+               public ConnectionFactory(Uri serverUrl, string clientId)
+                       : this(serverUrl, clientId, null)
                {
                }
 
                public ConnectionFactory(string serverUrl)
+                       : this(new Uri(serverUrl))
                {
-                       try
-                       {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl);
-                               this.brokerUri = new Uri(serverUrl);
-                       }
-                       catch(Exception ex)
-                       {
-                               Apache.NMS.Tracer.DebugFormat("Exception 
instantiating TIBCO.EMS.ConnectionFactory: {0}", ex.Message);
-                               ExceptionUtil.WrapAndThrowNMSException(ex);
-                       }
-
-                       VerifyConnectionFactory();
                }
 
                public ConnectionFactory(string serverUrl, string clientId)
+                       : this(new Uri(serverUrl), clientId)
                {
-                       try
-                       {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl, clientId);
-                               this.brokerUri = new Uri(serverUrl);
-                               this.clientId = clientId;
-                       }
-                       catch(Exception ex)
-                       {
-                               Apache.NMS.Tracer.DebugFormat("Exception 
instantiating TIBCO.EMS.ConnectionFactory: {0}", ex.Message);
-                               ExceptionUtil.WrapAndThrowNMSException(ex);
-                       }
-
-                       VerifyConnectionFactory();
                }
 
                public ConnectionFactory(string serverUrl, string clientId, 
Hashtable properties)
+                       : this(new Uri(serverUrl), clientId, properties)
+               {
+               }
+
+               public ConnectionFactory(Uri serverUrl, string clientId, 
Hashtable properties)
                {
                        try
                        {
-                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl, clientId, properties);
-                               this.brokerUri = new Uri(serverUrl);
+                               this.tibcoConnectionFactory = new 
TIBCO.EMS.ConnectionFactory(serverUrl.AbsolutePath, clientId, properties);
+                               this.brokerUri = serverUrl;
                                this.clientId = clientId;
                                this.properties = properties;
                        }


Reply via email to