activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r809656 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs
Date Mon, 31 Aug 2009 16:40:25 GMT
Author: jgomes
Date: Mon Aug 31 16:40:25 2009
New Revision: 809656

URL: http://svn.apache.org/viewvc?rev=809656&view=rev
Log:
Applied patch from Iddo Shoham to support composite URIs.  Thanks, Iddo!
Fixes [AMQNET-184]. (See https://issues.apache.org/activemq/browse/AMQNET-184)

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs?rev=809656&r1=809655&r2=809656&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/Discovery/DiscoveryTransportFactory.cs
Mon Aug 31 16:40:25 2009
@@ -17,6 +17,7 @@
 
 using System;
 using System.Threading;
+using Apache.NMS.Util;
 using Apache.NMS.ActiveMQ.Transport.Discovery.Multicast;
 using Apache.NMS.ActiveMQ.Transport.Tcp;
 
@@ -86,7 +87,14 @@
 
 		public ITransport CreateTransport(Uri location)
 		{
-			if(!agent.IsStarted)
+            URISupport.CompositeData cd = URISupport.parseComposite(location);
+
+            if(cd.Components.Length > 0)
+            {
+                agent.DiscoveryURI = cd.Components[0];
+            }
+
+            if(!agent.IsStarted)
 			{
 				agent.Start();
 			}
@@ -110,7 +118,7 @@
 
 		public ITransport CompositeConnect(Uri location)
 		{
-			throw new NMSConnectionException("Composite connection not supported with MulticastDiscovery
transport.");
+            return CreateTransport(location);
 		}
 
 



Mime
View raw message