Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-07-01 11:10:44 -0400
committerEike Stepper2010-07-01 11:10:44 -0400
commitf8406f9f2bc025b6845b6204ffcf7e8f8c18c8f5 (patch)
treede3ee7a1f3162005e3b11e14de445ffcc1f59974
parent6b106bc585c1be5794687ddfa6fffbd4f54c6b85 (diff)
downloadcdo-f8406f9f2bc025b6845b6204ffcf7e8f8c18c8f5.tar.gz
cdo-f8406f9f2bc025b6845b6204ffcf7e8f8c18c8f5.tar.xz
cdo-f8406f9f2bc025b6845b6204ffcf7e8f8c18c8f5.zip
[316444] Provide an option to prevent containment cycles
https://bugs.eclipse.org/bugs/show_bug.cgi?id=316444
-rw-r--r--plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF54
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java32
3 files changed, 49 insertions, 40 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
index 67b0723d23..931da88f7b 100644
--- a/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@ Bundle-Activator: org.eclipse.emf.cdo.internal.server.bundle.OM$Activator
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
- org.eclipse.emf.cdo;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
+ org.eclipse.emf.cdo;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
+ org.eclipse.net4j.util;bundle-version="[3.1.0,4.0.0)";visibility:=reexport
Export-Package: org.eclipse.emf.cdo.internal.server;version="3.0.100";x-friends:="org.eclipse.emf.cdo.server.db,org.eclipse.emf.cdo.server.net4j,org.eclipse.emf.cdo.tests",
org.eclipse.emf.cdo.internal.server.bundle;version="3.0.100";x-internal:=true,
org.eclipse.emf.cdo.internal.server.embedded;version="3.0.100";x-friends:="org.eclipse.emf.cdo.tests",
diff --git a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
index 37958f8adb..0fa14bd948 100644
--- a/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.util/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.net4j.util;singleton:=true
-Bundle-Version: 3.0.100.qualifier
+Bundle-Version: 3.1.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -14,30 +14,30 @@ Import-Package: org.eclipse.osgi.service.debug;version="[1.0.0,2.0.0)";resolutio
org.osgi.framework;version="[1.3.0,2.0.0)";resolution:=optional,
org.osgi.service.log;version="[1.3.0,2.0.0)";resolution:=optional,
org.osgi.util.tracker;version="[1.3.0,2.0.0)";resolution:=optional
-Export-Package: org.eclipse.net4j.internal.util.bundle;version="3.0.100";x-friends:="org.eclipse.net4j.util.ui,org.eclipse.net4j.tests",
- org.eclipse.net4j.internal.util.container;version="3.0.100";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.factory;version="3.0.100";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.om;version="3.0.100";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.internal.util.om.pref;version="3.0.100";x-friends:="org.eclipse.net4j.util.defs",
- org.eclipse.net4j.util;version="3.0.100",
- org.eclipse.net4j.util.cache;version="3.0.100",
- org.eclipse.net4j.util.collection;version="3.0.100",
- org.eclipse.net4j.util.concurrent;version="3.0.100",
- org.eclipse.net4j.util.container;version="3.0.100",
- org.eclipse.net4j.util.container.delegate;version="3.0.100",
- org.eclipse.net4j.util.event;version="3.0.100",
- org.eclipse.net4j.util.factory;version="3.0.100",
- org.eclipse.net4j.util.fsm;version="3.0.100",
- org.eclipse.net4j.util.io;version="3.0.100",
- org.eclipse.net4j.util.lifecycle;version="3.0.100",
- org.eclipse.net4j.util.om;version="3.0.100",
- org.eclipse.net4j.util.om.log;version="3.0.100",
- org.eclipse.net4j.util.om.monitor;version="3.0.100",
- org.eclipse.net4j.util.om.pref;version="3.0.100",
- org.eclipse.net4j.util.om.trace;version="3.0.100",
- org.eclipse.net4j.util.options;version="3.0.100",
- org.eclipse.net4j.util.ref;version="3.0.100",
- org.eclipse.net4j.util.registry;version="3.0.100",
- org.eclipse.net4j.util.security;version="3.0.100",
- org.eclipse.net4j.util.transaction;version="3.0.100"
+Export-Package: org.eclipse.net4j.internal.util.bundle;version="3.1.0";x-friends:="org.eclipse.net4j.util.ui,org.eclipse.net4j.tests",
+ org.eclipse.net4j.internal.util.container;version="3.1.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.factory;version="3.1.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.om;version="3.1.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.internal.util.om.pref;version="3.1.0";x-friends:="org.eclipse.net4j.util.defs",
+ org.eclipse.net4j.util;version="3.1.0",
+ org.eclipse.net4j.util.cache;version="3.1.0",
+ org.eclipse.net4j.util.collection;version="3.1.0",
+ org.eclipse.net4j.util.concurrent;version="3.1.0",
+ org.eclipse.net4j.util.container;version="3.1.0",
+ org.eclipse.net4j.util.container.delegate;version="3.1.0",
+ org.eclipse.net4j.util.event;version="3.1.0",
+ org.eclipse.net4j.util.factory;version="3.1.0",
+ org.eclipse.net4j.util.fsm;version="3.1.0",
+ org.eclipse.net4j.util.io;version="3.1.0",
+ org.eclipse.net4j.util.lifecycle;version="3.1.0",
+ org.eclipse.net4j.util.om;version="3.1.0",
+ org.eclipse.net4j.util.om.log;version="3.1.0",
+ org.eclipse.net4j.util.om.monitor;version="3.1.0",
+ org.eclipse.net4j.util.om.pref;version="3.1.0",
+ org.eclipse.net4j.util.om.trace;version="3.1.0",
+ org.eclipse.net4j.util.options;version="3.1.0",
+ org.eclipse.net4j.util.ref;version="3.1.0",
+ org.eclipse.net4j.util.registry;version="3.1.0",
+ org.eclipse.net4j.util.security;version="3.1.0",
+ org.eclipse.net4j.util.transaction;version="3.1.0"
Eclipse-BuddyPolicy: registered
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java
index 078d121881..3502c51d3d 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java
@@ -22,8 +22,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
/**
* Support Multiple reads/no write and upgrade lock from read to write. Many context could request
@@ -198,7 +198,21 @@ public class RWLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWLock
return entry != null && lockingStrategy.isLockedByOthers(entry, context);
}
- private LockStrategy<OBJECT, CONTEXT> getLockingStrategy(LockType type)
+ /**
+ * @since 3.1
+ */
+ protected LockEntry<OBJECT, CONTEXT> getLockEntry(OBJECT objectToLock)
+ {
+ synchronized (lockChanged)
+ {
+ return lockEntries.get(objectToLock);
+ }
+ }
+
+ /**
+ * @since 3.1
+ */
+ protected LockStrategy<OBJECT, CONTEXT> getLockingStrategy(LockType type)
{
if (type == LockType.READ)
{
@@ -334,18 +348,11 @@ public class RWLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWLock
return null;
}
- private LockEntry<OBJECT, CONTEXT> getLockEntry(OBJECT objectToLock)
- {
- synchronized (lockChanged)
- {
- return lockEntries.get(objectToLock);
- }
- }
-
/**
* @author Simon McDuff
+ * @since 3.1
*/
- private interface LockStrategy<OBJECT, CONTEXT>
+ protected interface LockStrategy<OBJECT, CONTEXT>
{
public boolean isLocked(LockEntry<OBJECT, CONTEXT> entry, CONTEXT context);
@@ -360,8 +367,9 @@ public class RWLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWLock
/**
* @author Simon McDuff
+ * @since 3.1
*/
- private interface LockEntry<OBJECT, CONTEXT>
+ protected interface LockEntry<OBJECT, CONTEXT>
{
public OBJECT getObject();

Back to the top