diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-15 09:43:16 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-15 09:43:16 +0000 |
commit | 7c66d5dff2273acf4d32da658d6ac5d59b9f20a7 (patch) | |
tree | 2d45e104df0cade3514367a290669fe48526cac2 /java/sca/modules/extensibility | |
parent | e7b0ee0d6edfe9aa70d282f77bd809bba632108e (diff) |
TUSCANY-2539 Turn of jar caching for URLconnection and port service discovery over to use URLConnetion to open streams. Prevents Tuscany from holding the stream open for Jar contributions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@686185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/extensibility')
-rw-r--r-- | java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClasspathServiceDiscoverer.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClasspathServiceDiscoverer.java b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClasspathServiceDiscoverer.java index 59c50785a6..8e3bd80da5 100644 --- a/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClasspathServiceDiscoverer.java +++ b/java/sca/modules/extensibility/src/main/java/org/apache/tuscany/sca/extensibility/ClasspathServiceDiscoverer.java @@ -25,6 +25,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.lang.ref.WeakReference; import java.net.URL; +import java.net.URLConnection; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; @@ -199,6 +200,13 @@ public class ClasspathServiceDiscoverer implements ServiceDiscoverer { try { is = AccessController.doPrivileged(new PrivilegedExceptionAction<InputStream>() { public InputStream run() throws IOException { + URLConnection connection = url.openConnection(); + // TUSCANY-2539 + // Don't cache connections by default to stop Tuscany locking contribution jar files + // done here as this is one of the first places we open a stream and the only way to + // set the default is to set it on an instance of URLConnection + connection.setDefaultUseCaches(false); + connection.setUseCaches(false); return url.openStream(); } }); |