axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r329773 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment: DeploymentEngine.java repository/util/ArchiveFileData.java util/Utils.java
Date Mon, 31 Oct 2005 08:53:25 GMT
Author: deepal
Date: Mon Oct 31 00:53:14 2005
New Revision: 329773

URL: http://svn.apache.org/viewcvs?rev=329773&view=rev
Log:
committing missing file

Added:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=329773&r1=329772&r2=329773&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
Mon Oct 31 00:53:14 2005
@@ -25,7 +25,7 @@
 import org.apache.axis2.deployment.scheduler.Scheduler;
 import org.apache.axis2.deployment.scheduler.SchedulerTask;
 import org.apache.axis2.deployment.util.PhasesInfo;
-import org.apache.axis2.deployment.util.Util;
+import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.*;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationImpl;
@@ -822,20 +822,20 @@
      * @throws DeploymentException
      */
     private void setClassLoaders(File axis2repo) throws DeploymentException {
-        ClassLoader sysClassLoader = Util.getClassLoader(
+        ClassLoader sysClassLoader = Utils.getClassLoader(
                 Thread.currentThread().getContextClassLoader(), axis2repo);
         axisConfig.setSystemClassLoader(sysClassLoader);
 
         File services = new File(axis2repo, "services");
         if (services.exists()) {
-            axisConfig.setServiceClassLoader(Util.getClassLoader(
+            axisConfig.setServiceClassLoader(Utils.getClassLoader(
                     axisConfig.getSystemClassLoader(), services));
         } else {
             axisConfig.setServiceClassLoader(axisConfig.getSystemClassLoader());
         }
         File modules = new File(axis2repo, "modules");
         if (modules.exists()) {
-            axisConfig.setServiceClassLoader(Util.getClassLoader(
+            axisConfig.setServiceClassLoader(Utils.getClassLoader(
                     axisConfig.getSystemClassLoader(), modules));
         } else {
             axisConfig.setModuleClassLoader(axisConfig.getSystemClassLoader());

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java?rev=329773&r1=329772&r2=329773&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/repository/util/ArchiveFileData.java
Mon Oct 31 00:53:14 2005
@@ -19,7 +19,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.deployment.DeploymentClassLoader;
 import org.apache.axis2.deployment.DeploymentErrorMsgs;
-import org.apache.axis2.deployment.util.Util;
+import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.i18n.Messages;
 
@@ -125,7 +125,7 @@
             }
         } else {
             if (file != null) {
-                classLoader = Util.getClassLoader(parent,file);
+                classLoader = Utils.getClassLoader(parent,file);
             }
         }
 

Added: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java?rev=329773&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
(added)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/util/Utils.java
Mon Oct 31 00:53:14 2005
@@ -0,0 +1,73 @@
+package org.apache.axis2.deployment.util;
+
+import org.apache.axis2.deployment.DeploymentException;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.MalformedURLException;
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* @author : Deepal Jayasinghe (deepal@apache.org)
+*
+*/
+
+public class Utils {
+
+    public static ClassLoader getClassLoader(ClassLoader parent , File file) throws DeploymentException
{
+        URLClassLoader classLoader;
+        if (file != null) {
+            try {
+                ArrayList urls = new ArrayList();
+                urls.add(file.toURL());
+                //if lib is simple
+                File libfiles = new File(file, "lib");
+                if (libfiles.exists()) {
+                    urls.add(libfiles.toURL());
+                    File jarfiles [] = libfiles.listFiles();
+                    for (int i = 0; i < jarfiles.length; i++) {
+                        File jarfile = jarfiles[i];
+                        if (jarfile.getName().endsWith(".jar")) {
+                            urls.add(jarfile.toURL());
+                        }
+                    }
+                }
+                //if lib is capital
+                libfiles = new File(file, "Lib");
+                if (libfiles.exists()) {
+                    urls.add(libfiles.toURL());
+                    File jarfiles [] = libfiles.listFiles();
+                    for (int i = 0; i < jarfiles.length; i++) {
+                        File jarfile = jarfiles[i];
+                        if (jarfile.getName().endsWith(".jar")) {
+                            urls.add(jarfile.toURL());
+                        }
+                    }
+                }
+                URL urllist [] = new URL[urls.size()];
+                for (int i = 0; i < urls.size(); i++) {
+                    urllist[i] = (URL) urls.get(i);
+                }
+                classLoader = new URLClassLoader(urllist, parent);
+                return classLoader;
+            } catch (MalformedURLException e) {
+                throw new DeploymentException(e);
+            }
+        }
+        return null;
+    }
+}



Mime
View raw message