Minor API change.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@417658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-06-28 03:26:05 +00:00
parent 6086520836
commit faff4999f4
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public abstract class ClassLoaderSPIConnectionFactory implements SPIConnectionFa
ClassLoader newClassLoader = getContextClassLoader(settings); ClassLoader newClassLoader = getContextClassLoader(settings);
Thread.currentThread().setContextClassLoader(newClassLoader); Thread.currentThread().setContextClassLoader(newClassLoader);
return instantiateConnectionFactory(newClassLoader, settings); return instantiateConnectionFactory(settings);
} }
protected ClassLoader getContextClassLoader(Properties settings) { protected ClassLoader getContextClassLoader(Properties settings) {
@ -76,5 +76,5 @@ public abstract class ClassLoaderSPIConnectionFactory implements SPIConnectionFa
return ClassLoaderSPIConnectionFactory.class.getClassLoader(); return ClassLoaderSPIConnectionFactory.class.getClassLoader();
} }
protected abstract ConnectionFactory instantiateConnectionFactory(ClassLoader cl, Properties settings) throws Exception; protected abstract ConnectionFactory instantiateConnectionFactory(Properties settings) throws Exception;
} }

View File

@ -23,8 +23,8 @@ import java.util.Properties;
public abstract class ReflectionSPIConnectionFactory extends ClassLoaderSPIConnectionFactory { public abstract class ReflectionSPIConnectionFactory extends ClassLoaderSPIConnectionFactory {
public ConnectionFactory instantiateConnectionFactory(ClassLoader cl, Properties settings) throws Exception { public ConnectionFactory instantiateConnectionFactory(Properties settings) throws Exception {
Class factoryClass = cl.loadClass(getClassName()); Class factoryClass = Thread.currentThread().getContextClassLoader().loadClass(getClassName());
ConnectionFactory factory = (ConnectionFactory)factoryClass.newInstance(); ConnectionFactory factory = (ConnectionFactory)factoryClass.newInstance();
configureConnectionFactory(factory, settings); configureConnectionFactory(factory, settings);
return factory; return factory;