axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r525695 - in /webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2: ./ deployment/ deployment/repository/util/ deployment/util/
Date Thu, 05 Apr 2007 04:47:56 GMT
Author: dims
Date: Wed Apr  4 21:47:54 2007
New Revision: 525695

URL: http://svn.apache.org/viewvc?view=rev&rev=525695
Log:
Fix for AXIS2-2455 - Using Servlect Specification conform FileCaching AND fix for hotdeployment
failure (unable to delete jar)

Modified:
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/Constants.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
    webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/Constants.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/Constants.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/Constants.java
Wed Apr  4 21:47:54 2007
@@ -245,6 +245,8 @@
         public static final String ENABLE_REST = "enableREST";
         public static final String ENABLE_REST_THROUGH_GET = "restThroughGet";
 
+        public static final String ARTIFACTS_TEMP_DIR = "artifactsDIR";
+
         //Attachment configurations
         public static final String ENABLE_MTOM = "enableMTOM";
         public static final String CACHE_ATTACHMENTS = "cacheAttachments";

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
Wed Apr  4 21:47:54 2007
@@ -29,7 +29,9 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Enumeration;
+import java.util.List;
 import java.util.HashMap;
+
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -38,38 +40,22 @@
     private URL[] urls = null;
 
     // List of jar files inside the jars in the original url
-    private ArrayList embedded_jars;
+    private List embedded_jars;
 
     private HashMap loadedClass = new HashMap();
 
     /**
      * DeploymentClassLoader is extended from URLClassLoader. The constructor
-     * does not override the super constructor, but does additional steps like find out
+     * does not override the super constructor, but takes in an addition list of
      * jar files inside /lib directory.
      *
      * @param urls   <code>URL</code>s
      * @param parent parent classloader <code>ClassLoader</code>
      */
-    public DeploymentClassLoader(URL[] urls, ClassLoader parent, boolean antiJARLocking)
{
-        super(Utils.getURLsForAllJars(urls[0]), parent);
-    }
-
-    /**
-     * Experimental!! Is not hooked up yet.
-     *
-     * @param urls
-     * @param parent
-     */
-    public DeploymentClassLoader(URL[] urls, ClassLoader parent) {
+    public DeploymentClassLoader(URL[] urls, List embedded_jars, ClassLoader parent) {
         super(urls, parent);
         this.urls = urls;
-        /**
-         * though the URL array can contain one or more urls , we only consider the
-         * first one, since this classLoader is only for Axis2 and the classloader
-         * is created by Deployment, we definitely know that there will be only one url in
-         * the URL array list
-         */
-        embedded_jars = Utils.findLibJars(urls[0]);
+        this.embedded_jars = embedded_jars;
     }
 
     /**
@@ -105,6 +91,7 @@
         }
         return clazz;
     }
+
 
     /**
      * Finds the resource with the specified name on the URL search path.

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
Wed Apr  4 21:47:54 2007
@@ -19,6 +19,7 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
@@ -210,10 +211,12 @@
                 String fileUrl = (String) fileIterator.next();
                 if (fileUrl.endsWith(".mar")) {
                     URL moduleurl = new URL(moduleDir, fileUrl);
-                    DeploymentClassLoader deploymentClassLoader =
-                            new DeploymentClassLoader(
+                    ClassLoader deploymentClassLoader =
+                           Utils.createClassLoader(
                                     new URL[]{moduleurl},
-                                    axisConfig.getModuleClassLoader(), false);
+                                    axisConfig.getModuleClassLoader(),
+                                    true,
+                                    (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                     AxisModule module = new AxisModule();
                     module.setModuleClassLoader(deploymentClassLoader);
                     module.setParent(axisConfig);
@@ -258,8 +261,11 @@
                                         String serviceName) throws DeploymentException {
         try {
             serviceGroup.setServiceGroupName(serviceName);
-            DeploymentClassLoader serviceClassLoader = new DeploymentClassLoader(
-                    new URL[]{servicesURL}, axisConfig.getServiceClassLoader(), false);
+            ClassLoader serviceClassLoader = Utils.createClassLoader(
+                    new URL[]{servicesURL},
+                    axisConfig.getServiceClassLoader(),
+                    true,
+                    (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
             String metainf = "meta-inf";
             serviceGroup.setServiceGroupClassLoader(serviceClassLoader);
             //processing wsdl.list
@@ -902,7 +908,7 @@
             axismodule = new AxisModule();
             ArchiveReader archiveReader = new ArchiveReader();
 
-            currentDeploymentFile.setClassLoader(false, config.getModuleClassLoader());
+            currentDeploymentFile.setClassLoader(false, config.getModuleClassLoader(), null);
             axismodule.setModuleClassLoader(currentDeploymentFile.getClassLoader());
             archiveReader.readModuleArchive(currentDeploymentFile, axismodule,
                                             false, config);

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ModuleDeployer.java
Wed Apr  4 21:47:54 2007
@@ -1,6 +1,7 @@
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
@@ -12,6 +13,7 @@
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.io.File;
 import java.net.MalformedURLException;
 
 /*
@@ -35,6 +37,7 @@
 public class ModuleDeployer implements Deployer {
 
     private static final Log log = LogFactory.getLog(ModuleDeployer.class);
+    private ConfigurationContext configCtx;
     private AxisConfiguration axisConfig;
 
 
@@ -47,6 +50,7 @@
 
     //To initialize the deployer
     public void init(ConfigurationContext configCtx) {
+        this.configCtx = configCtx;
         this.axisConfig = configCtx.getAxisConfiguration();
     }
     //Will process the file and add that to axisConfig
@@ -55,14 +59,15 @@
         ArchiveReader archiveReader = new ArchiveReader();
         String moduleStatus = "";
         StringWriter errorWriter = new StringWriter();
-        boolean explodedDir = deploymentFileData.getFile().isDirectory();
+        boolean isDirectory = deploymentFileData.getFile().isDirectory();
         try {
-            deploymentFileData.setClassLoader(explodedDir,
-                                              axisConfig.getModuleClassLoader());
+            deploymentFileData.setClassLoader(isDirectory,
+                                              axisConfig.getModuleClassLoader(),
+                    (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
             AxisModule metaData = new AxisModule();
             metaData.setModuleClassLoader(deploymentFileData.getClassLoader());
             metaData.setParent(axisConfig);
-            archiveReader.readModuleArchive(deploymentFileData, metaData, explodedDir,
+            archiveReader.readModuleArchive(deploymentFileData, metaData, isDirectory,
                                             axisConfig);
             metaData.setFileName(deploymentFileData.getFile().toURL());
             DeploymentEngine.addNewModule(metaData, axisConfig);

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
Wed Apr  4 21:47:54 2007
@@ -10,6 +10,7 @@
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.util.Loader;
 import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.java2wsdl.AnnotationConstants;
@@ -68,10 +69,12 @@
                 File file = deploymentFileData.getFile();
                 if (file != null) {
                     File parentFile = file.getParentFile();
-                    DeploymentClassLoader classLoader =
-                            new DeploymentClassLoader(new URL[]{parentFile.toURL()},
-                                                      configCtx
-                                                              .getAxisConfiguration().getSystemClassLoader(),false);
+                    ClassLoader classLoader =
+                            Utils.createClassLoader(new URL[]{parentFile.toURL()},
+                                    configCtx.getAxisConfiguration().getSystemClassLoader(),
+                                    true,
+                                    (File)configCtx.getAxisConfiguration()
+                                            .getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                     Thread.currentThread().setContextClassLoader(classLoader);
                     String className = file.getName();
                     className = className.replaceAll(".class", "");
@@ -166,9 +169,11 @@
                 ArrayList axisServiceList = new ArrayList();
                 for (int i = 0; i < classList.size(); i++) {
                     String className = (String) classList.get(i);
-                    DeploymentClassLoader classLoader = new DeploymentClassLoader(
+                    ClassLoader classLoader = Utils.createClassLoader(
                             new URL[]{deploymentFileData.getFile().toURL()},
-                            configCtx.getAxisConfiguration().getSystemClassLoader(),false);
+                            configCtx.getAxisConfiguration().getSystemClassLoader(),
+                            true,
+                            (File)configCtx.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                     Thread.currentThread().setContextClassLoader(classLoader);
                     className = className.replaceAll(".class", "");
                     className = className.replaceAll("/", ".");

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/ServiceDeployer.java
Wed Apr  4 21:47:54 2007
@@ -1,6 +1,7 @@
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
@@ -14,6 +15,7 @@
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -50,14 +52,15 @@
     //Will process the file and add that to axisConfig
 
     public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException
{
-        boolean explodedDir = deploymentFileData.getFile().isDirectory();
+        boolean isDirectory = deploymentFileData.getFile().isDirectory();
         ArchiveReader archiveReader;
         StringWriter errorWriter = new StringWriter();
         archiveReader = new ArchiveReader();
         String serviceStatus = "";
         try {
-            deploymentFileData.setClassLoader(explodedDir,
-                                              axisConfig.getServiceClassLoader());
+            deploymentFileData.setClassLoader(isDirectory,
+                                              axisConfig.getServiceClassLoader(),
+                    (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
             HashMap wsdlservice = archiveReader.processWSDLs(deploymentFileData);
             if (wsdlservice != null && wsdlservice.size() > 0) {
                 Iterator services = wsdlservice.values().iterator();
@@ -75,7 +78,7 @@
                     deploymentFileData.getClassLoader());
             ArrayList serviceList = archiveReader.processServiceGroup(
                     deploymentFileData.getAbsolutePath(), deploymentFileData,
-                    sericeGroup, explodedDir, wsdlservice,
+                    sericeGroup, isDirectory, wsdlservice,
                     configCtx);
             DeploymentEngine.addServiceGroup(sericeGroup,
                                              serviceList,

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/WarBasedAxisConfigurator.java
Wed Apr  4 21:47:54 2007
@@ -1,6 +1,7 @@
 package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -92,7 +93,6 @@
         try {
             this.config = servletConfig;
             InputStream axis2Stream = null;
-
             try {
 
                 if (axis2Stream == null) {
@@ -135,6 +135,15 @@
             }
             axisConfig = populateAxisConfiguration(axis2Stream);
 
+            Parameter param = new Parameter();
+            param.setName(Constants.Configuration.ARTIFACTS_TEMP_DIR);
+            param.setValue(config.getServletContext().getAttribute("javax.servlet.context.tempdir"));
+            try {
+                axisConfig.addParameter(param);
+            } catch (AxisFault axisFault) {
+                log.error(axisFault);
+            }
+
             // when the module is an unpacked war file,
             // we can set the web location path in the deployment engine.
             // This will let us
@@ -312,6 +321,7 @@
 
     public void setConfigContext(ConfigurationContext configContext) {
         super.setConfigContext(configContext);
+
         // setting ServletContext into configctx
         configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT,
                                   config.getServletContext());

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
Wed Apr  4 21:47:54 2007
@@ -108,25 +108,24 @@
         this.classLoader = classLoader;
     }
 
-    public void setClassLoader(boolean extractArchive, ClassLoader parent) throws AxisFault
{
-        if (!extractArchive) {
-
-            if (file != null) {
+    public void setClassLoader(boolean isDirectory, ClassLoader parent, File file) throws
AxisFault {
+        if (!isDirectory) {
+            if (this.file != null) {
                 URL[] urlsToLoadFrom;
                 try {
-                    if (!file.exists()) {
+                    if (!this.file.exists()) {
                         throw new AxisFault(Messages.getMessage(DeploymentErrorMsgs.FILE_NOT_FOUND,
-                                                                file.getAbsolutePath()));
+                                                                this.file.getAbsolutePath()));
                     }
-                    urlsToLoadFrom = new URL[]{file.toURL()};
-                    classLoader = new DeploymentClassLoader(urlsToLoadFrom, parent,false);
+                    urlsToLoadFrom = new URL[]{this.file.toURL()};
+                    classLoader = Utils.createClassLoader(urlsToLoadFrom, parent, true, file);
                 } catch (Exception e) {
                     throw new AxisFault(e);
                 }
             }
         } else {
-            if (file != null) {
-                classLoader = Utils.getClassLoader(parent, file);
+            if (this.file != null) {
+                classLoader = Utils.getClassLoader(parent, this.file);
             }
         }
     }

Modified: webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=525695&r1=525694&r2=525695
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
Wed Apr  4 21:47:54 2007
@@ -8,6 +8,7 @@
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.deployment.DeploymentConstants;
 import org.apache.axis2.deployment.DeploymentException;
+import org.apache.axis2.deployment.DeploymentClassLoader;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.deployment.repository.util.DeploymentFileData;
 import org.apache.axis2.description.AxisMessage;
@@ -46,6 +47,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -53,6 +55,7 @@
 import java.util.LinkedList;
 import java.util.Stack;
 import java.util.StringTokenizer;
+import java.util.List;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
@@ -117,15 +120,22 @@
         }
     }
 
-    public static URL[] getURLsForAllJars(URL url) {
+    public static URL[] getURLsForAllJars(URL url, File tmpDir) {
         try {
             ArrayList array = new ArrayList();
             String urlString = url.toString();
             InputStream in = url.openStream();
+            String fileName = url.getFile();
+            int index = fileName.lastIndexOf('/');
+            if(index != -1) {
+                fileName = fileName.substring(index+1);
+            }
+            File f = createTempFile(fileName, in, tmpDir);
+            in.close();
             ZipInputStream zin;
-            FileInputStream fin = null;
-                array.add(url);
-                zin = new ZipInputStream(in);
+            FileInputStream fin = new FileInputStream(f);
+                array.add(f.toURL());
+                zin = new ZipInputStream(fin);
 
             ZipEntry entry;
             String entryName;
@@ -138,7 +148,7 @@
                 if ((entryName != null) && entryName.toLowerCase().startsWith("lib/")
                         && entryName.toLowerCase().endsWith(".jar")) {
                     String suffix = entryName.substring(4);
-                    File f = createTempFile(suffix, zin);
+                    f = createTempFile(suffix, zin, tmpDir);
                     array.add(f.toURL());
                 }
             }
@@ -152,11 +162,19 @@
         }
     }
 
-    public static File createTempFile(String suffix, InputStream in) throws IOException {
+    public static File createTempFile(String suffix, InputStream in, File tmpDir) throws
IOException {
         byte data[] = new byte[2048];
         int count;
-        new File(System.getProperty("java.io.tmpdir")).mkdirs();
-        File f = File.createTempFile("axis2", suffix);
+        File f;
+        if(tmpDir == null) {
+            new File(System.getProperty("java.io.tmpdir")).mkdirs();
+            f = File.createTempFile("axis2", suffix);
+        } else {
+            f = File.createTempFile("axis2", suffix, tmpDir);
+        }
+        if(log.isDebugEnabled()) {
+            log.info("Created temporary file : " + f.getAbsolutePath());
+        }
         f.deleteOnExit();
         FileOutputStream out = new FileOutputStream(f);
         while ((count = in.read(data, 0, 2048)) != -1) {
@@ -462,14 +480,17 @@
                     }
                     InputStream fin = moduleClassLoader.getResourceAsStream("aars/" + servicename);
                     if (fin == null) {
-                        throw new AxisFault("No service archiev found : " + servicename);
+                        throw new AxisFault("No service archive found : " + servicename);
                     }
-                    File inputFile = Utils.createTempFile(servicename, fin);
+                    File inputFile = Utils.createTempFile(servicename,
+                            fin,
+                            (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                     DeploymentFileData filedata = new DeploymentFileData(inputFile,
                                                                          DeploymentConstants.TYPE_SERVICE);
 
                     filedata.setClassLoader(false,
-                                            moduleClassLoader);
+                                            moduleClassLoader,
+                            (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                     HashMap wsdlservice = archiveReader.processWSDLs(filedata);
                     if (wsdlservice != null && wsdlservice.size() > 0) {
                         Iterator servicesitr = wsdlservice.values().iterator();
@@ -595,7 +616,7 @@
      * Searches for jar files inside /lib dirctory. If there are any, the
      * names of those jar files will be added to the array list
      */
-    public static ArrayList findLibJars(URL url) {
+    public static List findLibJars(URL url) {
         ArrayList embedded_jars = new ArrayList();
         try {
             ZipInputStream zin = new ZipInputStream(url.openStream());
@@ -630,5 +651,16 @@
         excludeList.add("startUp");
         excludeList.add("destroy");
         excludeList.add("shutDown");
+    }
+
+    public static ClassLoader createClassLoader(URL[] urls, ClassLoader serviceClassLoader,
+                                                boolean extractJars, File tmpDir) {
+        if(extractJars) {
+            URL[] urls1 = Utils.getURLsForAllJars(urls[0], tmpDir);
+            return new DeploymentClassLoader(urls1, null, serviceClassLoader);
+        } else {
+            List embedded_jars = Utils.findLibJars(urls[0]);
+            return new DeploymentClassLoader(urls, embedded_jars, serviceClassLoader);
+        }
     }
 }



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


Mime
View raw message