axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-4349) Child first class loading
Date Sat, 02 Jul 2016 13:35:11 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15360176#comment-15360176
] 

Hudson commented on AXIS2-4349:
-------------------------------

SUCCESS: Integrated in Axis2 #3571 (See [https://builds.apache.org/job/Axis2/3571/])
AXIS2-5792: Use the same class loaders on Windows as on Unix, to make EnableChildFirstClassLoading
work (AXIS2-4349 only implementd that feature for Unix). This effectively reverts the change
implemented in AXIS2-4072 and instead levarages the fact that on recent Java versions, URLClassLoader
has a close() method. (veithen: rev 1751057)
* axis2/modules/kernel/src/org/apache/axis2/classloader/AbstractResourceHandle.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/AbstractUrlResourceLocation.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/DirectoryResourceHandle.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/DirectoryResourceLocation.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/IoUtil.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarFileClassLoader.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarResourceHandle.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarResourceLocation.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/ResourceEnumeration.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/ResourceFinder.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/ResourceHandle.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/ResourceLocation.java
* axis2/modules/kernel/src/org/apache/axis2/classloader/UrlResourceFinder.java
* axis2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
* axis2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
* axis2/modules/kernel/test/org/apache/axis2/classloader


> Child first class loading
> -------------------------
>
>                 Key: AXIS2-4349
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4349
>             Project: Axis2
>          Issue Type: Improvement
>            Reporter: Amila Chinthaka Suriarachchi
>             Fix For: 1.5.5, 1.6.0
>
>         Attachments: child_first_class_loading.patch, classloaderpatch.txt
>
>
> Currently Axis2 follows the parent first class loading for service and module loading.

> The reason for this is it uses DeploymentClassLoader loader which is extended from the
ClassLoader class.
> The loadClass method of the ClassLoader class looks like this.
> protected synchronized Class<?> loadClass(String name, boolean resolve)
> 	throws ClassNotFoundException
>     {
> 	// First, check if the class has already been loaded
> 	Class c = findLoadedClass(name);
> 	if (c == null) {
> 	    try {
> 		if (parent != null) {
> 		    c = parent.loadClass(name, false);
> 		} else {
> 		    c = findBootstrapClass0(name);
> 		}
> 	    } catch (ClassNotFoundException e) {
> 	        // If still not found, then invoke findClass in order
> 	        // to find the class.
> 	        c = findClass(name);
> 	    }
> 	}
> 	if (resolve) {
> 	    resolveClass(c);
> 	}
> 	return c;
>     }
> it first check for parent class loader classes and then for its classes. So we can add
child first class loading simply reversing this order in a override loadClass method as follows.
> protected synchronized Class<?> loadClass(String name, boolean resolve) throws
ClassNotFoundException {
>         Class c = findLoadedClass(name);
>         if (c == null) {
>             try {
>                 c = findClass(name);
>             } catch (Exception e) {
>                 c = super.loadClass(name, resolve);
>             }
>         }
>         return c;
>     }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message