Author: jgomes
Date: Thu Oct 23 15:41:39 2008
New Revision: 707489
URL: http://svn.apache.org/viewvc?rev=707489&view=rev
Log:
Apply patch from Daniel Ellis. Thanks Daniel!
http://www.nabble.com/Small-patch-for-apache.nms.msmq-to20115344.html
Modified:
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
Modified:
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
URL:
http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs?rev=707489&r1=707488&r2=707489&view=diff
==============================================================================
---
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
(original)
+++
activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/ConnectionFactory.cs
Thu Oct 23 15:41:39 2008
@@ -24,17 +24,43 @@
/// </summary>
public class ConnectionFactory : IConnectionFactory
{
- public ConnectionFactory()
- {
- }
+ public const string DEFAULT_BROKER_URL = "msmq://localhost";
+ public const string ENV_BROKER_URL = "MSMQ_BROKER_URL";
- public ConnectionFactory(String brokerUri)
+ public static string GetDefaultBrokerUrl()
{
+ string answer = Environment.GetEnvironmentVariable(ENV_BROKER_URL);
+ if (answer == null)
+ {
+ answer = DEFAULT_BROKER_URL;
+ }
+ return answer;
}
- public ConnectionFactory(String brokerUri, string clientID)
- {
- }
+ public ConnectionFactory()
+ : this(GetDefaultBrokerUrl())
+ {
+ }
+
+ public ConnectionFactory(string brokerUri)
+ : this(brokerUri, null)
+ {
+ }
+
+ public ConnectionFactory(string brokerUri, string clientID)
+ : this(new Uri(brokerUri), clientID)
+ {
+ }
+
+ public ConnectionFactory(Uri brokerUri)
+ : this(brokerUri, null)
+ {
+ }
+
+ public ConnectionFactory(Uri brokerUri, string clientID)
+ {
+
+ }
/// <summary>
/// Creates a new connection to MSMQ.