You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2007/03/15 15:42:14 UTC
svn commit: r518644 - in
/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2:
classloader/ deployment/ deployment/repository/util/ deployment/util/
receivers/ util/
Author: dims
Date: Thu Mar 15 07:42:13 2007
New Revision: 518644
URL: http://svn.apache.org/viewvc?view=rev&rev=518644
Log:
We used to extract the embedded jars (in aar's and mar's) and create temporary jars in the TEMP directory. This was causing a big headache since the disk gets filled up in production environments. Trying this new approach of setting up a URLStreamHandler for jars that can reference the embedded jars with URLClassLoader.
Added:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java (contents, props changed)
- copied, changed from r518111, webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MultiParentClassLoader.java
Removed:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MultiParentClassLoader.java
Modified:
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java?view=auto&rev=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlConnection.java Thu Mar 15 07:42:13 2007
@@ -0,0 +1,132 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.axis2.classloader;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.security.Permission;
+import java.security.cert.Certificate;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
+
+/**
+ * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
+ */
+public class JarFileUrlConnection extends JarURLConnection {
+ public static final URL DUMMY_JAR_URL;
+ static {
+ try {
+ DUMMY_JAR_URL = new URL("jar", "", -1, "file:dummy!/", new URLStreamHandler() {
+ protected URLConnection openConnection(URL u) {
+ throw new UnsupportedOperationException();
+ }
+ });
+ } catch (Exception e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
+ private final URL url;
+ private final JarFile jarFile;
+ private final JarEntry jarEntry;
+ private final URL jarFileUrl;
+
+ public JarFileUrlConnection(URL url, JarFile jarFile, JarEntry jarEntry) throws MalformedURLException {
+ super(DUMMY_JAR_URL);
+
+ if (url == null) throw new NullPointerException("url is null");
+ if (jarFile == null) throw new NullPointerException("jarFile is null");
+ if (jarEntry == null) throw new NullPointerException("jarEntry is null");
+
+ this.url = url;
+ this.jarFile = jarFile;
+ this.jarEntry = jarEntry;
+ jarFileUrl = new File(jarFile.getName()).toURL();
+ }
+
+ public JarFile getJarFile() throws IOException {
+ return jarFile;
+ }
+
+ public synchronized void connect() {
+ }
+
+ public URL getJarFileURL() {
+ return jarFileUrl;
+ }
+
+ public String getEntryName() {
+ return getJarEntry().getName();
+ }
+
+ public Manifest getManifest() throws IOException {
+ return jarFile.getManifest();
+ }
+
+ public JarEntry getJarEntry() {
+ return jarEntry;
+ }
+
+ public Attributes getAttributes() throws IOException {
+ return getJarEntry().getAttributes();
+ }
+
+ public Attributes getMainAttributes() throws IOException {
+ return getManifest().getMainAttributes();
+ }
+
+ public Certificate[] getCertificates() throws IOException {
+ return getJarEntry().getCertificates();
+ }
+
+ public URL getURL() {
+ return url;
+ }
+
+ public int getContentLength() {
+ long size = getJarEntry().getSize();
+ if (size > Integer.MAX_VALUE) {
+ return -1;
+ }
+ return (int) size;
+ }
+
+ public long getLastModified() {
+ return getJarEntry().getTime();
+ }
+
+ public synchronized InputStream getInputStream() throws IOException {
+ return jarFile.getInputStream(jarEntry);
+ }
+
+ public Permission getPermission() throws IOException {
+ URL jarFileUrl = new File(jarFile.getName()).toURL();
+ return jarFileUrl.openConnection().getPermission();
+ }
+
+ public String toString() {
+ return JarFileUrlConnection.class.getName() + ":" + url;
+ }
+}
Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java?view=auto&rev=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarFileUrlStreamHandler.java Thu Mar 15 07:42:13 2007
@@ -0,0 +1,110 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.axis2.classloader;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
+ */
+public class JarFileUrlStreamHandler extends URLStreamHandler {
+ public static URL createUrl(JarFile jarFile, JarEntry jarEntry) throws MalformedURLException {
+ return createUrl(jarFile, jarEntry, new File(jarFile.getName()).toURL());
+ }
+
+ public static URL createUrl(JarFile jarFile, JarEntry jarEntry, URL codeSource) throws MalformedURLException {
+ JarFileUrlStreamHandler handler = new JarFileUrlStreamHandler(jarFile, jarEntry);
+ URL url = new URL("jar", "", -1, codeSource + "!/" + jarEntry.getName(), handler);
+ handler.setExpectedUrl(url);
+ return url;
+ }
+
+ private URL expectedUrl;
+ private JarFile jarFile = null;
+ private JarEntry jarEntry = null;
+
+ public JarFileUrlStreamHandler() {
+ }
+
+ public JarFileUrlStreamHandler(JarFile jarFile, JarEntry jarEntry) {
+ if (jarFile == null) throw new NullPointerException("jarFile is null");
+ if (jarEntry == null) throw new NullPointerException("jarEntry is null");
+
+ this.jarFile = jarFile;
+ this.jarEntry = jarEntry;
+ }
+
+ public void setExpectedUrl(URL expectedUrl) {
+ if (expectedUrl == null) throw new NullPointerException("expectedUrl is null");
+ this.expectedUrl = expectedUrl;
+ }
+
+ public URLConnection openConnection(URL url) throws IOException {
+
+ if (expectedUrl == null || !expectedUrl.equals(url)) {
+ // the new url is supposed to be within our context, so it must have a jar protocol
+ if (!url.getProtocol().equals("jar")) {
+ throw new IllegalArgumentException("Unsupported protocol " + url.getProtocol());
+ }
+
+ // split the path at "!/" into the file part and entry part
+ String path = url.getPath();
+ String[] chunks = path.split("!/", 2);
+
+ // if we only got only one chunk, it didn't contain the required "!/" delimiter
+ if (chunks.length == 1) {
+ throw new MalformedURLException("Url does not contain a '!' character: " + url);
+ }
+
+ String file = chunks[0];
+ String entryPath = chunks[1];
+
+ // this handler only supports jars on the local file system
+ if (!file.startsWith("file:")) {
+ // let the system handler deal with this
+ return new URL(url.toExternalForm()).openConnection();
+ }
+ file = file.substring("file:".length());
+
+ File f = new File(file);
+ if (f.exists()) {
+ jarFile = new JarFile(f);
+ }
+
+ if (jarFile == null) {
+ throw new FileNotFoundException("Cannot find JarFile: " + file);
+ }
+
+ // get the entry
+ jarEntry = jarFile.getJarEntry(entryPath);
+ if (jarEntry == null) {
+ throw new FileNotFoundException("Entry not found: " + url);
+ }
+ expectedUrl = url;
+ }
+
+ return new JarFileUrlConnection(url, jarFile, jarEntry);
+ }
+}
Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java?view=auto&rev=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/JarStreamHandlerFactory.java Thu Mar 15 07:42:13 2007
@@ -0,0 +1,29 @@
+/*
+* 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.
+*/
+
+package org.apache.axis2.classloader;
+
+import java.net.URLStreamHandlerFactory;
+import java.net.URLStreamHandler;
+
+public class JarStreamHandlerFactory implements URLStreamHandlerFactory {
+ public URLStreamHandler createURLStreamHandler(String protocol) {
+ if("jar".equalsIgnoreCase(protocol)){
+ return new JarFileUrlStreamHandler();
+ }
+ return null;
+ }
+}
Copied: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java (from r518111, webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MultiParentClassLoader.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java?view=diff&rev=518644&p1=webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MultiParentClassLoader.java&r1=518111&p2=webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/MultiParentClassLoader.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java Thu Mar 15 07:42:13 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.axis2.util;
+package org.apache.axis2.classloader;
import org.apache.commons.logging.LogFactory;
Propchange: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentClassLoader.java Thu Mar 15 07:42:13 2007
@@ -17,6 +17,7 @@
package org.apache.axis2.deployment;
+import org.apache.axis2.classloader.JarStreamHandlerFactory;
import org.apache.axis2.deployment.util.Utils;
import java.net.URL;
@@ -32,6 +33,11 @@
* @param parent parent classloader <code>ClassLoader</code>
*/
public DeploymentClassLoader(URL[] urls, ClassLoader parent, boolean antiJARLocking) {
- super(Utils.getURLsForAllJars(urls[0], antiJARLocking), parent);
+// super(Utils.getURLsForAllJars(urls[0], antiJARLocking), parent);
+ super(Utils.getURLsForAllJars(urls[0]), parent, new JarStreamHandlerFactory());
+ }
+
+ public DeploymentClassLoader(URL[] urls, ClassLoader parent) {
+ super(Utils.getURLsForAllJars(urls[0]), parent, new JarStreamHandlerFactory());
}
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java Thu Mar 15 07:42:13 2007
@@ -64,7 +64,6 @@
private static final Log log = LogFactory.getLog(DeploymentEngine.class);
protected boolean hotUpdate = true; // to do hot update or not
protected boolean hotDeployment = true; // to do hot deployment or not
- protected boolean antiJARLocking = false; // to do hot deployment or not
/**
* Stores all the web Services to deploy.
*/
@@ -199,8 +198,7 @@
DeploymentClassLoader deploymentClassLoader =
new DeploymentClassLoader(
new URL[]{moduleurl},
- axisConfig.getModuleClassLoader(),
- antiJARLocking);
+ axisConfig.getModuleClassLoader());
AxisModule module = new AxisModule();
module.setModuleClassLoader(deploymentClassLoader);
module.setParent(axisConfig);
@@ -246,7 +244,7 @@
try {
serviceGroup.setServiceGroupName(serviceName);
DeploymentClassLoader serviceClassLoader = new DeploymentClassLoader(
- new URL[]{servicesURL}, axisConfig.getServiceClassLoader(), antiJARLocking);
+ new URL[]{servicesURL}, axisConfig.getServiceClassLoader());
String metainf = "meta-inf";
serviceGroup.setServiceGroupClassLoader(serviceClassLoader);
//processing wsdl.list
@@ -699,10 +697,6 @@
return hotUpdate;
}
- public boolean isAntiJARLocking() {
- return antiJARLocking;
- }
-
/**
* To set the all the classLoader hierarchy this method can be used , the top most parent is
* CCL then SCL(system Class Loader)
@@ -750,7 +744,6 @@
String value;
Parameter parahotdeployment = axisConfig.getParameter(TAG_HOT_DEPLOYMENT);
Parameter parahotupdate = axisConfig.getParameter(TAG_HOT_UPDATE);
-// Parameter paraantiJARLocking = axisConfig.getParameter(TAG_ANTI_JAR_LOCKING);
if (parahotdeployment != null) {
value = (String) parahotdeployment.getValue();
@@ -770,10 +763,6 @@
if (parahotupdate != null) {
value = (String) parahotupdate.getValue();
-
- if ("true".equalsIgnoreCase(value)) {
- antiJARLocking = true;
- }
}
String serviceDirPara = (String)
axisConfig.getParameterValue(DeploymentConstants.SERVICE_DIR_PATH);
@@ -901,8 +890,7 @@
AxisModule axismodule;
try {
DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
- DeploymentConstants.TYPE_MODULE,
- false);
+ DeploymentConstants.TYPE_MODULE);
axismodule = new AxisModule();
ArchiveReader archiveReader = new ArchiveReader();
@@ -960,16 +948,11 @@
AxisConfiguration axisConfig = configCtx.getAxisConfiguration();
Parameter parahotupdate = axisConfig.getParameter(TAG_HOT_UPDATE);
- boolean antiJARLocking = true;
if (parahotupdate != null) {
String value = (String) parahotupdate.getValue();
-
- if ("false".equalsIgnoreCase(value)) {
- antiJARLocking = false;
- }
}
DeploymentFileData currentDeploymentFile = new DeploymentFileData(
- DeploymentConstants.TYPE_SERVICE, "", antiJARLocking);
+ DeploymentConstants.TYPE_SERVICE, "");
currentDeploymentFile.setClassLoader(classLoader);
ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
@@ -1001,7 +984,7 @@
ArchiveReader archiveReader,
HashMap wsdlServices) throws AxisFault {
DeploymentFileData currentDeploymentFile = new DeploymentFileData(
- DeploymentConstants.TYPE_SERVICE, "", false);
+ DeploymentConstants.TYPE_SERVICE, "");
currentDeploymentFile.setClassLoader(classLoader);
AxisServiceGroup serviceGroup = new AxisServiceGroup();
serviceGroup.setServiceGroupClassLoader(classLoader);
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Thu Mar 15 07:42:13 2007
@@ -70,8 +70,7 @@
DeploymentClassLoader classLoader =
new DeploymentClassLoader(new URL[]{parentFile.toURL()},
configCtx
- .getAxisConfiguration().getSystemClassLoader(),
- true);
+ .getAxisConfiguration().getSystemClassLoader());
Thread.currentThread().setContextClassLoader(classLoader);
String className = file.getName();
className = className.replaceAll(".class", "");
@@ -168,7 +167,7 @@
String className = (String) classList.get(i);
DeploymentClassLoader classLoader = new DeploymentClassLoader(
new URL[]{deploymentFileData.getFile().toURL()},
- configCtx.getAxisConfiguration().getSystemClassLoader(), true);
+ configCtx.getAxisConfiguration().getSystemClassLoader());
Thread.currentThread().setContextClassLoader(classLoader);
className = className.replaceAll(".class", "");
className = className.replaceAll("/", ".");
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Thu Mar 15 07:42:13 2007
@@ -35,21 +35,18 @@
private ArrayList deployableServices = new ArrayList();
private ClassLoader classLoader;
private String messageReceiver;
- private boolean lock;
private String name;
private String type;
- public DeploymentFileData(File file, String type, boolean lock) {
+ public DeploymentFileData(File file, String type) {
this.file = file;
this.type = type;
- this.lock = lock;
}
- public DeploymentFileData(String type, String name, boolean lock) {
+ public DeploymentFileData(String type, String name) {
this.type = type;
this.name = name;
- this.lock = lock;
}
public String getAbsolutePath() {
@@ -122,7 +119,7 @@
file.getAbsolutePath()));
}
urlsToLoadFrom = new URL[]{file.toURL()};
- classLoader = new DeploymentClassLoader(urlsToLoadFrom, parent, lock);
+ classLoader = new DeploymentClassLoader(urlsToLoadFrom, parent);
} catch (Exception e) {
throw new AxisFault(e);
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Thu Mar 15 07:42:13 2007
@@ -69,7 +69,7 @@
WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_SERVICE);
jarList.add(wsInfo);
DeploymentFileData deploymentFileData =
- new DeploymentFileData(file, TYPE_SERVICE, deployer.isAntiJARLocking());
+ new DeploymentFileData(file, TYPE_SERVICE);
deployer.addWSToDeploy(
deploymentFileData); // inform that new web service is deployed
} else {
@@ -81,8 +81,7 @@
tempWSInfo.getLastModifiedDate(), TYPE_SERVICE);
deployer.addWSToUndeploy(wsInfo); // add entry to undeploy list
DeploymentFileData deploymentFileData = new DeploymentFileData(file,
- TYPE_SERVICE,
- deployer.isAntiJARLocking());
+ TYPE_SERVICE);
deployer.addWSToDeploy(deploymentFileData); // add entry to deploylist
}
}
@@ -93,7 +92,7 @@
WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_MODULE);
jarList.add(wsInfo);
DeploymentFileData deploymentFileData =
- new DeploymentFileData(file, TYPE_MODULE, false);
+ new DeploymentFileData(file, TYPE_MODULE);
deployer.addWSToDeploy(
deploymentFileData); // inform that new web service is deployed
}
@@ -104,7 +103,7 @@
WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), extension);
jarList.add(wsInfo);
DeploymentFileData deploymentFileData =
- new DeploymentFileData(file, extension, deployer.isAntiJARLocking());
+ new DeploymentFileData(file, extension);
deployer.addWSToDeploy(
deploymentFileData); // inform that new web service is deployed
} else {
@@ -117,8 +116,7 @@
deployer.addWSToUndeploy(
wsInfo); // add entry to undeploy list
DeploymentFileData deploymentFileData = new DeploymentFileData(file,
- extension,
- deployer.isAntiJARLocking());
+ extension);
deployer.addWSToDeploy(
deploymentFileData); // add entry to deploylist
}
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Thu Mar 15 07:42:13 2007
@@ -162,6 +162,35 @@
}
}
+ public static URL[] getURLsForAllJars(URL url) {
+ try {
+ ArrayList array = new ArrayList();
+ String urlString = url.toString();
+ InputStream in = url.openStream();
+ ZipInputStream zin = new ZipInputStream(in);
+
+ array.add(url);
+
+ ZipEntry entry;
+ String entryName;
+ while ((entry = zin.getNextEntry()) != null) {
+ entryName = entry.getName();
+ /**
+ * id the entry name start with /lib and end with .jar
+ * then those entry name will be added to the arraylist
+ */
+ if ((entryName != null) && entryName.toLowerCase().startsWith("lib/")
+ && entryName.toLowerCase().endsWith(".jar")) {
+ array.add(new URL("jar", "", -1, url.toString() + "!/" + entry.getName()));
+ }
+ }
+ zin.close();
+ return (URL[]) array.toArray(new URL[array.size()]);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
public static File createTempFile(String suffix, InputStream in) throws IOException {
byte data[] = new byte[2048];
int count;
@@ -472,8 +501,7 @@
}
File inputFile = Utils.createTempFile(servicename, fin);
DeploymentFileData filedata = new DeploymentFileData(inputFile,
- DeploymentConstants.TYPE_SERVICE,
- false);
+ DeploymentConstants.TYPE_SERVICE);
filedata.setClassLoader(false,
moduleClassLoader);
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java?view=diff&rev=518644&r1=518643&r2=518644
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java Thu Mar 15 07:42:13 2007
@@ -31,7 +31,7 @@
import org.apache.axis2.engine.MessageReceiver;
import org.apache.axis2.i18n.Messages;
import org.apache.axis2.util.Loader;
-import org.apache.axis2.util.MultiParentClassLoader;
+import org.apache.axis2.classloader.MultiParentClassLoader;
import java.lang.reflect.Method;
import java.net.URL;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org