in src/main/csharp/CommonConnectionFactory.cs [77:118]
private void LoadConnectionFactory()
{
lock(connectionFactoryLock)
{
if(null == factoryType)
{
// Load the assembly and get the type.
string assemblyFileName = (is32bit ? "Apache.NMS.ZMQ32.dll" : "Apache.NMS.ZMQ64.dll");
string[] searchPaths = GetAssemblySearchPaths();
foreach(string path in searchPaths)
{
string fullFileName = Path.Combine(path, assemblyFileName);
try
{
factoryAssembly = Assembly.LoadFile(fullFileName);
if(null != factoryAssembly)
{
Tracer.DebugFormat("Succesfully loaded provider: {0}", fullFileName);
factoryType = factoryAssembly.GetType("Apache.NMS.ZMQ.ConnectionFactory", true, true);
if(null != factoryType)
{
break;
}
}
}
catch(Exception ex)
{
Tracer.DebugFormat("Exception loading assembly {0} failed: {1}", fullFileName, ex.Message);
factoryType = null;
}
}
if(null == factoryType)
{
Tracer.ErrorFormat("Failed to load assembly {0}", assemblyFileName);
throw new ApplicationException(string.Format("Could not load the ZMQ connection factory assembly {0}.", assemblyFileName));
}
}
}
}