Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2013-08-09 15:40:12 +0000
committerThomas Watson2013-08-09 15:40:12 +0000
commit82eb53a76b471d2e60a50482dbd964881f33ce59 (patch)
treedfe517ff5323029b22c0926df51c06e88f31f4e9 /bundles/org.eclipse.osgi/supplement/src
parentcb43515b73a68568331c1532e23e9065e7a7ac15 (diff)
downloadrt.equinox.framework-82eb53a76b471d2e60a50482dbd964881f33ce59.tar.gz
rt.equinox.framework-82eb53a76b471d2e60a50482dbd964881f33ce59.tar.xz
rt.equinox.framework-82eb53a76b471d2e60a50482dbd964881f33ce59.zip
Bug 414724 - osgi.locking configuration setting is ignored and java.nio
locking is always used
Diffstat (limited to 'bundles/org.eclipse.osgi/supplement/src')
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/LocationHelper.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/LocationHelper.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/LocationHelper.java
index 24d8f7d09..75da9a911 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/LocationHelper.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/internal/location/LocationHelper.java
@@ -20,6 +20,9 @@ import org.eclipse.osgi.internal.location.Locker.MockLocker;
*/
public class LocationHelper {
public static final String PROP_OSGI_LOCKING = "osgi.locking"; //$NON-NLS-1$
+ public static final String LOCKING_NONE = "none"; //$NON-NLS-1$
+ public static final String LOCKING_IO = "java.io"; //$NON-NLS-1$
+ public static final String LOCKING_NIO = "java.nio"; //$NON-NLS-1$
/**
* Builds a URL with the given specification
@@ -60,13 +63,17 @@ public class LocationHelper {
}
public static Locker createLocker(File lock, String lockMode, boolean debug) {
- if ("none".equals(lockMode)) //$NON-NLS-1$
+ if (lockMode == null) {
+ // try to get the lockMode from the system properties
+ lockMode = System.getProperty(PROP_OSGI_LOCKING);
+ }
+ if (LOCKING_NONE.equals(lockMode)) {
return new MockLocker();
-
- if ("java.io".equals(lockMode)) //$NON-NLS-1$
+ }
+ if (LOCKING_IO.equals(lockMode)) {
return new Locker_JavaIo(lock);
-
- if ("java.nio".equals(lockMode)) { //$NON-NLS-1$
+ }
+ if (LOCKING_NIO.equals(lockMode)) {
return new Locker_JavaNio(lock, debug);
}

Back to the top