Author: shawkins
Date: 2009-05-15 10:37:19 -0400 (Fri, 15 May 2009)
New Revision: 946
Added:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
Removed:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java
Modified:
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java
trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java
trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
Log:
TEIID-600 renaming non to post delegating and changing common extension to be a delegating
classloader.
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-15
14:34:39 UTC (rev 945)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -44,7 +44,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.protocol.MMURLConnection;
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.common.protocol.URLHelper;
@@ -390,7 +390,7 @@
if (postDelegationClasspathList != null &&
!postDelegationClasspathList.isEmpty()) {
URL[] path = postDelegationClasspathList.toArray(new
URL[postDelegationClasspathList.size()]);
- this.classLoader = new NonDelegatingClassLoader(path, this.classLoader, new
MetaMatrixURLStreamHandlerFactory());
+ this.classLoader = new PostDelegatingClassLoader(path, this.classLoader, new
MetaMatrixURLStreamHandlerFactory());
}
String logMsg =
BaseDataSource.getResourceMessage("EmbeddedDriver.use_classpath");
//$NON-NLS-1$
Deleted:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.common.classloader;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLStreamHandlerFactory;
-
-/**
- * This Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of classes, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- */
-public class NonDelegatingClassLoader extends URLClassLoader {
-
- public NonDelegatingClassLoader(URL[] urls, ClassLoader parent) {
- super(urls, parent);
- }
-
- public NonDelegatingClassLoader(URL[] urls, ClassLoader parent,
URLStreamHandlerFactory factory) {
- super(urls, parent, factory);
- }
-
-
- public NonDelegatingClassLoader(URL[] urls) {
- super(urls);
- }
-
-
- /**
- * By overriding this method, this Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of classes, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- * <p>
- * @param name The name of the class to load
- * @return Class loaded Class object
- * @see java.lang.ClassLoader#loadClass(java.lang.String)
- */
- public synchronized Class loadClass(String name) throws ClassNotFoundException {
-
- Class loadedClass = this.findLoadedClass(name);
- if (loadedClass != null) {
- return loadedClass;
- }
-
-
- // class not in cache
- try {
- loadedClass = super.findClass(name);
- } catch (ClassNotFoundException e) {
- // ignore, check parent ClassLoader
- } catch (SecurityException e) {
- // ignore, check parent ClassLoader
- /*
- * ClassLoader.defineClass throws a SecurityException if this
- * ClassLoader attempts to load a class under the "java."
- * package hierarchy.
- */
- }
-
- // if class not found, delegate to parent
- if(loadedClass == null) {
- // Will throw ClassNotFoundException if not found in parent
- loadedClass = this.getParent().loadClass(name);
- }
-
-
- return loadedClass;
- }
-
-
- /**
- * By overriding this method, this Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of resources, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- * @param name The name of the resource to load
- * @return URL of resource
- * @see java.lang.ClassLoader#getResource(java.lang.String)
- */
- public URL getResource(String name) {
- URL url = super.findResource(name);
- if (url == null){
- url = this.getParent().getResource(name);
- }
- return url;
- }
-}
Copied:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
(from rev 941,
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java)
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
(rev 0)
+++
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.common.classloader;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLStreamHandlerFactory;
+
+/**
+ * This Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of classes, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ */
+public class PostDelegatingClassLoader extends URLClassLoader {
+
+ public PostDelegatingClassLoader(URL[] urls, ClassLoader parent) {
+ super(urls, parent);
+ }
+
+ public PostDelegatingClassLoader(URL[] urls, ClassLoader parent,
URLStreamHandlerFactory factory) {
+ super(urls, parent, factory);
+ }
+
+
+ public PostDelegatingClassLoader(URL[] urls) {
+ super(urls);
+ }
+
+
+ /**
+ * By overriding this method, this Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of classes, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ * <p>
+ * @param name The name of the class to load
+ * @return Class loaded Class object
+ * @see java.lang.ClassLoader#loadClass(java.lang.String)
+ */
+ public synchronized Class loadClass(String name) throws ClassNotFoundException {
+
+ Class loadedClass = this.findLoadedClass(name);
+ if (loadedClass != null) {
+ return loadedClass;
+ }
+
+
+ // class not in cache
+ try {
+ loadedClass = super.findClass(name);
+ } catch (ClassNotFoundException e) {
+ // ignore, check parent ClassLoader
+ } catch (SecurityException e) {
+ // ignore, check parent ClassLoader
+ /*
+ * ClassLoader.defineClass throws a SecurityException if this
+ * ClassLoader attempts to load a class under the "java."
+ * package hierarchy.
+ */
+ }
+
+ // if class not found, delegate to parent
+ if(loadedClass == null) {
+ // Will throw ClassNotFoundException if not found in parent
+ loadedClass = this.getParent().loadClass(name);
+ }
+
+
+ return loadedClass;
+ }
+
+
+ /**
+ * By overriding this method, this Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of resources, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ * @param name The name of the resource to load
+ * @return URL of resource
+ * @see java.lang.ClassLoader#getResource(java.lang.String)
+ */
+ public URL getResource(String name) {
+ URL url = super.findResource(name);
+ if (url == null){
+ url = this.getParent().getResource(name);
+ }
+ return url;
+ }
+}
Property changes on:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java
===================================================================
---
trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -23,6 +23,7 @@
package com.metamatrix.common.classloader;
import java.net.URL;
+import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
import java.util.ArrayList;
import java.util.HashSet;
@@ -35,12 +36,12 @@
/**
* @since 4.3
*/
-public class URLFilteringClassLoader extends NonDelegatingClassLoader {
+public class URLFilteringClassLoader extends URLClassLoader {
- private static HashSet excludeProtocols = null;
+ private static HashSet<String> excludeProtocols = null;
static {
- excludeProtocols = new HashSet();
+ excludeProtocols = new HashSet<String>();
excludeProtocols.add("extensionjar"); //$NON-NLS-1$
excludeProtocols.add(ClasspathURLConnection.PROTOCOL);
excludeProtocols.add(MMFileURLConnection.PROTOCOL);
@@ -80,7 +81,7 @@
* JBOSS is using to filter out our extensionjar URLs. Interestingly, WebLogic
does not use this
* function, so I think JBOSS may be doing something wrong here.
*/
- ArrayList temp = new ArrayList();
+ ArrayList<URL> temp = new ArrayList<URL>();
URL[] all = super.getURLs();
for (int i = 0; i < all.length; i++) {
String protocol = all[i].getProtocol();
@@ -88,7 +89,7 @@
temp.add(all[i]);
}
}
- return (URL[])temp.toArray(new URL[temp.size()]);
+ return temp.toArray(new URL[temp.size()]);
}
}
Modified:
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -1,7 +1,5 @@
package com.metamatrix.api.exception;
-import static org.junit.Assert.*;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
@@ -14,9 +12,7 @@
import org.junit.Test;
-import com.metamatrix.api.exception.ExceptionHolder;
-import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.util.ReflectionHelper;
import com.metamatrix.core.util.UnitTestUtil;
@@ -34,7 +30,7 @@
}
@Test public void testDeserializationUnknownException() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
Object obj = ReflectionHelper.create("test.Test", null, cl); //$NON-NLS-1$
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -60,7 +56,7 @@
}
@Test public void testDeserializationUnknownChildException() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
Exception obj = (Exception)ReflectionHelper.create("test.UnknownException",
null, cl); //$NON-NLS-1$
obj.initCause(new SQLException("something bad happended")); //$NON-NLS-1$
@@ -82,7 +78,7 @@
}
@Test public void testDeserializationUnknownChildException2() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[]
{UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
ArrayList<String> args = new ArrayList<String>();
args.add("Unknown Exception"); //$NON-NLS-1$
Exception obj = (Exception)ReflectionHelper.create("test.UnknownException",
args, cl); //$NON-NLS-1$
Modified:
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -36,7 +36,7 @@
import com.metamatrix.core.util.UnitTestUtil;
/**
- * Test {@link NonDelegatingClassLoader}
+ * Test {@link PostDelegatingClassLoader}
*/
public class TestNonDelegatingClassLoader extends TestCase {
@@ -52,8 +52,8 @@
private URL[] getURLs() throws Exception {
URL[] result = new URL[2];
- result[0] =
UnitTestUtil.getTestDataFile("extensionmodule/testjar.jar").toURL();
//$NON-NLS-1$
- result[1] =
UnitTestUtil.getTestDataFile("extensionmodule/testjar2.jar").toURL();
//$NON-NLS-1$
+ result[0] =
UnitTestUtil.getTestDataFile("extensionmodule/testjar.jar").toURI().toURL();
//$NON-NLS-1$
+ result[1] =
UnitTestUtil.getTestDataFile("extensionmodule/testjar2.jar").toURI().toURL();
//$NON-NLS-1$
return result;
}
@@ -63,16 +63,16 @@
String classname = "com.test.TestClass"; //$NON-NLS-1$
String expectedToString = "This is a test class"; //$NON-NLS-1$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(getURLs());
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(getURLs());
- Class clazz = loader.loadClass(classname);
+ Class<?> clazz = loader.loadClass(classname);
Object obj = clazz.newInstance();
assertEquals(expectedToString, obj.toString());
}
public void testLoadResource() throws Exception {
String resourcename = "com/test/TestDoc.txt"; //$NON-NLS-1$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(getURLs());
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(getURLs());
InputStream stream = loader.getResourceAsStream(resourcename);
assertNotNull(stream);
@@ -90,7 +90,7 @@
public void testLoadResourceFileProtocol() throws Exception {
String resourcename = "nonModelFile.txt"; //$NON-NLS-1$
URL url = new URL("file", "localhost",
UnitTestUtil.getTestDataPath()); //$NON-NLS-1$ //$NON-NLS-2$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(new URL[] {
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(new URL[] {
url
});
@@ -102,13 +102,13 @@
}
public void testGetURLs() throws Exception {
- URL url1 = new URL("extensionjar", "localhost", -1,
"testjar.jar", new URLStreamHandler() {
+ URL url1 = new URL("extensionjar", "localhost", -1,
"testjar.jar", new URLStreamHandler() { //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
@Override
protected URLConnection openConnection(URL u) throws IOException {
return null;
- }}); //$NON-NLS-1$
- URL url2 = UnitTestUtil.getTestDataFile("Books.xsd").toURL();
//$NON-NLS-1$
- NonDelegatingClassLoader loader = new URLFilteringClassLoader(new URL[] {
+ }});
+ URL url2 = UnitTestUtil.getTestDataFile("Books.xsd").toURI().toURL();
//$NON-NLS-1$
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(new URL[] {
url1, url2
}, this.getClass().getClassLoader(), new MetaMatrixURLStreamHandlerFactory());
URL[] urls = loader.getURLs();
Modified:
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -22,11 +22,16 @@
package com.metamatrix.common.classloader;
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Proxy;
import java.net.URL;
import java.util.HashSet;
-import junit.framework.TestCase;
+import javax.sql.DataSource;
+import org.junit.Test;
+
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.common.protocol.URLHelper;
@@ -34,12 +39,12 @@
/**
* @since 4.3
*/
-public class TestURLFilteringClassLoader extends TestCase {
+public class TestURLFilteringClassLoader {
/*
* Test method for
'com.metamatrix.common.classloader.URLFilteringClassLoader.getURLs()'
*/
- public void testGetURLs() throws Exception{
+ @Test public void testGetURLs() throws Exception{
URL http =
URLHelper.buildURL("http://foo.com/foo.jar"); //$NON-NLS-1$
URL ftp =
URLHelper.buildURL("ftp://foo.com/foo.jar"); //$NON-NLS-1$
URL mmfile = URLHelper.buildURL("mmfile:foo.jar"); //$NON-NLS-1$
@@ -66,4 +71,5 @@
assertTrue(!filteredURLSet.contains(mmrofile));
assertTrue(!filteredURLSet.contains(classpath));
}
+
}
Modified:
trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java
===================================================================
---
trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -37,7 +37,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.core.util.UnitTestUtil;
@@ -157,7 +157,7 @@
URL patchurl = new URL(patchpath);
URL url = new URL(path);
- ClassLoader jarClassPath = new NonDelegatingClassLoader(new URL[] {patchurl,
url}, previousClsLoader);
+ ClassLoader jarClassPath = new PostDelegatingClassLoader(new URL[] {patchurl,
url}, previousClsLoader);
Thread.currentThread().setContextClassLoader(jarClassPath);
URL fooURL = URLHelper.buildURL("classpath:pathtest/foo.txt");
//$NON-NLS-1$
@@ -183,7 +183,7 @@
// Right now there is an error with issuing patches with "classpath"
// protocol (defect 21557), there is no fix just workaround, that is
// to reverse the url path to the class loader.
- ClassLoader jarClassLoader = new NonDelegatingClassLoader(new URL[] {url,
patchurl}, previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
+ ClassLoader jarClassLoader = new PostDelegatingClassLoader(new URL[] {url,
patchurl}, previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
// this is how it is supposed to work!
ClassLoader urlClassLoader = new URLClassLoader(new URL[] {patchurl, url},
previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
Modified:
trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java
===================================================================
---
trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -24,12 +24,8 @@
import junit.framework.TestCase;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
-/**
- * Test {@link NonDelegatingClassLoader}
- */
public class TestPropertyValidation extends TestCase {
/**
Modified: trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java 2009-05-15
14:34:39 UTC (rev 945)
+++ trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -27,7 +27,7 @@
import java.net.URL;
import java.util.Collection;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.query.function.metadata.FunctionMetadataReader;
import com.metamatrix.query.function.metadata.FunctionMethod;
@@ -72,7 +72,7 @@
// If the class loader is not created for the UDF functions then create
// one and cache it.
if (classLoader == null) {
- classLoader = new NonDelegatingClassLoader(this.classpath,
Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
+ classLoader = new PostDelegatingClassLoader(this.classpath,
Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
}
return classLoader.loadClass(className);
Modified:
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java 2009-05-15
14:34:39 UTC (rev 945)
+++
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java 2009-05-15
14:37:19 UTC (rev 946)
@@ -52,8 +52,7 @@
import com.metamatrix.common.application.ApplicationService;
import com.metamatrix.common.application.exception.ApplicationInitializationException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
-import com.metamatrix.common.classloader.URLFilteringClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.CurrentConfiguration;
@@ -114,7 +113,7 @@
* This is based on the assumption that two classloaders
* with the same URLs should be identical.
*/
- private static Map<String, WeakReference<NonDelegatingClassLoader>>
classLoaderCache = new HashMap<String,
WeakReference<NonDelegatingClassLoader>> ();
+ private static Map<String, WeakReference<PostDelegatingClassLoader>>
classLoaderCache = new HashMap<String,
WeakReference<PostDelegatingClassLoader>> ();
static {
//read value of cacheClassLoaders
@@ -204,9 +203,9 @@
}
synchronized (ConnectorService.class) {
- NonDelegatingClassLoader result = null;
+ PostDelegatingClassLoader result = null;
if (cacheClassLoaders) {
- WeakReference<NonDelegatingClassLoader> ref =
classLoaderCache.get(urls);
+ WeakReference<PostDelegatingClassLoader> ref =
classLoaderCache.get(urls);
if (ref != null) {
result = ref.get();
if (result != null) {
@@ -216,9 +215,9 @@
}
try {
- result = new URLFilteringClassLoader(URLFactory.parseURLs(urls,
";"), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
+ result = new PostDelegatingClassLoader(URLFactory.parseURLs(urls,
";"), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
if (cacheClassLoaders) {
- classLoaderCache.put(urls, new
WeakReference<NonDelegatingClassLoader>(result));
+ classLoaderCache.put(urls, new
WeakReference<PostDelegatingClassLoader>(result));
}
return result;
} catch (MalformedURLException e1) {