summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-09-26 00:24:20 (EDT)
committerCaspar De Groot2011-09-26 00:24:20 (EDT)
commit536a6217c8ceb6f344b0995e1843aefd8e713a45 (patch)
tree5e060ded5a473011e815b4135743447b0be508c3
parentfdf2ae7baba56f927e625b3458ee8d9b109d693e (diff)
downloadcdo-536a6217c8ceb6f344b0995e1843aefd8e713a45.zip
cdo-536a6217c8ceb6f344b0995e1843aefd8e713a45.tar.gz
cdo-536a6217c8ceb6f344b0995e1843aefd8e713a45.tar.bz2
[352330] Make lockArea loading vetoable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352330
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db4o/src/org/eclipse/emf/cdo/server/internal/db4o/DB4ODurableLockingManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/.settings/.api_filters648
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockingManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java)43
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java49
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOCommandProvider.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ILockingManager.java41
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java4
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/ConcurrentArray.java4
24 files changed, 509 insertions, 373 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
index d1cc2ba..d10fd22 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/lock/IDurableLockingManager.java
@@ -19,8 +19,7 @@ import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
import java.util.Map;
/**
- * Manages all aspects of durable CDO views like persisting informations like {@link CDOBranchPoint branch point} and
- * acquired locks.
+ * Manages all persistent aspects of durable CDO views such as {@link CDOBranchPoint branch point} and acquired locks.
*
* @author Eike Stepper
* @since 4.0
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java
index 3fb707d..7cbfd0a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DurableLockingManager.java
@@ -655,7 +655,7 @@ public class DurableLockingManager extends Lifecycle
stmtUpdate = statementCache.getPreparedStatement(sqlUpdateLock, ReuseProbability.MEDIUM);
stmtUpdate.setString(2, durableLockingID);
- InternalLockManager lockManager = accessor.getStore().getRepository().getLockManager();
+ InternalLockManager lockManager = accessor.getStore().getRepository().getLockingManager();
for (Object key : keys)
{
CDOID id = lockManager.getLockKeyID(key);
diff --git a/plugins/org.eclipse.emf.cdo.server.db4o/src/org/eclipse/emf/cdo/server/internal/db4o/DB4ODurableLockingManager.java b/plugins/org.eclipse.emf.cdo.server.db4o/src/org/eclipse/emf/cdo/server/internal/db4o/DB4ODurableLockingManager.java
index f1595de..c8db054 100644
--- a/plugins/org.eclipse.emf.cdo.server.db4o/src/org/eclipse/emf/cdo/server/internal/db4o/DB4ODurableLockingManager.java
+++ b/plugins/org.eclipse.emf.cdo.server.db4o/src/org/eclipse/emf/cdo/server/internal/db4o/DB4ODurableLockingManager.java
@@ -120,7 +120,7 @@ public class DB4ODurableLockingManager extends Lifecycle
LockArea area = getLockArea(accessor, durableLockingID);
Map<CDOID, LockGrade> locks = area.getLocks();
- InternalLockManager lockManager = accessor.getStore().getRepository().getLockManager();
+ InternalLockManager lockManager = accessor.getStore().getRepository().getLockingManager();
for (Object objectToLock : objectsToLock)
{
CDOID id = lockManager.getLockKeyID(objectToLock);
@@ -147,7 +147,7 @@ public class DB4ODurableLockingManager extends Lifecycle
LockArea area = getLockArea(accessor, durableLockingID);
Map<CDOID, LockGrade> locks = area.getLocks();
- InternalLockManager lockManager = accessor.getStore().getRepository().getLockManager();
+ InternalLockManager lockManager = accessor.getStore().getRepository().getLockingManager();
for (Object objectToUnlock : objectsToUnlock)
{
CDOID id = lockManager.getLockKeyID(objectToUnlock);
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
index 23d62ac..0ba55a4 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockAreaIndication.java
@@ -34,7 +34,7 @@ public class LockAreaIndication extends CDOServerWriteIndication
@Override
protected void indicating(CDODataInput in) throws IOException
{
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
int viewID = in.readInt();
InternalView view = getSession().getView(viewID);
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
index f14a2b3..68273d3 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockDelegationIndication.java
@@ -65,7 +65,7 @@ public class LockDelegationIndication extends LockObjectsIndication
// The viewID received as an argument, is the ID of the client's view, which
// does not exist on the master. So we ignore this argument and open a new
// view instead.
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
InternalSession session = getSession();
view = SyncingUtil.openViewWithLockArea(session, lockManager, viewedBranch, lockAreaID);
return view;
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
index 57d0c0e..37182b6 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockStateIndication.java
@@ -48,7 +48,7 @@ public class LockStateIndication extends CDOServerReadIndication
throw new IllegalStateException("View not found");
}
- InternalLockManager lockMgr = getRepository().getLockManager();
+ InternalLockManager lockMgr = getRepository().getLockingManager();
int n = in.readInt();
cdoLockStates = new CDOLockState[n];
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
index 1cc1707..d9ce78e 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/ObjectLockedIndication.java
@@ -40,7 +40,7 @@ public class ObjectLockedIndication extends CDOServerReadIndication
{
int viewID = in.readInt();
IView view = getSession().getView(viewID);
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
LockType lockType = in.readCDOLockType();
CDOID id = in.readCDOID();
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java
index 8eeedcc..15fa17c 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/OpenViewIndication.java
@@ -57,7 +57,7 @@ public class OpenViewIndication extends CDOServerReadIndication
}
else
{
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
try
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
index 1cd4666..83379c1 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/UnlockDelegationIndication.java
@@ -57,7 +57,7 @@ public class UnlockDelegationIndication extends UnlockObjectsIndication
@Override
protected IView getView(int viewID)
{
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
InternalSession session = getSession();
view = (InternalView)lockManager.openView(session, InternalSession.TEMP_VIEW_ID, true, lockAreaID);
return view;
diff --git a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
index 833c776..d87afb4 100644
--- a/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo.server/.settings/.api_filters
@@ -1,324 +1,324 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.emf.cdo.server" version="2">
- <resource path="src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java" type="org.eclipse.emf.cdo.internal.server.DelegatingRepository">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalRepository"/>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="DelegatingRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/LockManager.java" type="org.eclipse.emf.cdo.internal.server.LockManager$DurableView">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="DurableView"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="IView"/>
- <message_argument value="CDOCommonView"/>
- <message_argument value="DurableView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/QueryManager.java" type="org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="IQueryContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/Repository.java" type="org.eclipse.emf.cdo.internal.server.Repository">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOReplicationInfo"/>
- <message_argument value="Repository"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalRepository"/>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="Repository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ResourcesQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.ResourcesQueryHandler$QueryContext">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryResourcesContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="ServerCDOView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView$ServerCDOSession">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDORepositoryInfo"/>
- <message_argument value="ServerCDOSession"/>
- </message_arguments>
- </filter>
- <filter id="574619656">
- <message_arguments>
- <message_argument value="InternalCDOSession"/>
- <message_argument value="ServerCDOSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/Session.java" type="org.eclipse.emf.cdo.internal.server.Session">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalSession"/>
- <message_argument value="CDOCommonSession"/>
- <message_argument value="Session"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOIDAndBranch"/>
- <message_argument value="DeltaLockWrapper"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$XRefContext">
- <filter id="572522506">
- <message_arguments>
- <message_argument value="CDOIDReference"/>
- <message_argument value="XRefContext"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryXRefsContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="XRefContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/View.java" type="org.eclipse.emf.cdo.internal.server.View">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="View"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="InternalView"/>
- <message_argument value="CDOCommonView"/>
- <message_argument value="View"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/XRefsQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.XRefsQueryHandler$QueryContext">
- <filter id="572522506">
- <message_arguments>
- <message_argument value="CDOIDReference"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- <filter id="574660632">
- <message_arguments>
- <message_argument value="QueryXRefsContext"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionConfiguration$RepositoryInfo">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDORepositoryInfo"/>
- <message_argument value="RepositoryInfo"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionProtocol">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOSessionProtocol"/>
- <message_argument value="EmbeddedClientSessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedServerSessionProtocol">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="ISessionProtocol"/>
- <message_argument value="CDOProtocol"/>
- <message_argument value="EmbeddedServerSessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStore">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="DurableLocking"/>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="MEMStore"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStoreAccessor">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="DurableLocking"/>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="MEMStoreAccessor"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java" type="org.eclipse.emf.cdo.internal.server.syncing.OfflineClone$CommitContextData">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommitData"/>
- <message_argument value="CommitContextData"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IQueryContext.java" type="org.eclipse.emf.cdo.server.IQueryContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="IQueryContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IRepository.java" type="org.eclipse.emf.cdo.server.IRepository">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommonRepository"/>
- <message_argument value="IRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/ISession.java" type="org.eclipse.emf.cdo.server.ISession">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommonSession"/>
- <message_argument value="ISession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$DurableLocking">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="DurableLocking"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryResourcesContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryResourcesContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryXRefsContext">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="QueryXRefsContext"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/ITransaction.java" type="org.eclipse.emf.cdo.server.ITransaction">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOCommonTransaction"/>
- <message_argument value="ITransaction"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/IView.java" type="org.eclipse.emf.cdo.server.IView">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOCommonView"/>
- <message_argument value="IView"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSession.java" type="org.eclipse.emf.cdo.server.embedded.CDOSession">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOSession"/>
- <message_argument value="CDOSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSessionConfiguration.java" type="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOSessionConfiguration"/>
- <message_argument value="CDOSessionConfiguration"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/DurableLockArea.java" type="org.eclipse.emf.cdo.spi.server.DurableLockArea">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="LockArea"/>
- <message_argument value="DurableLockArea"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java" type="org.eclipse.emf.cdo.spi.server.ISessionProtocol">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOProtocol"/>
- <message_argument value="ISessionProtocol"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java" type="org.eclipse.emf.cdo.spi.server.InternalLockManager">
- <filter id="574619656">
- <message_arguments>
- <message_argument value="IDurableLockingManager"/>
- <message_argument value="InternalLockManager"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSession.java" type="org.eclipse.emf.cdo.spi.server.InternalSession">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="Options"/>
- <message_argument value="InternalSession"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSynchronizableRepository.java" type="org.eclipse.emf.cdo.spi.server.InternalSynchronizableRepository">
- <filter id="571473929">
- <message_arguments>
- <message_argument value="CDOReplicationContext"/>
- <message_argument value="InternalSynchronizableRepository"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/emf/cdo/spi/server/Store.java" type="org.eclipse.emf.cdo.spi.server.Store">
- <filter id="574660632">
- <message_arguments>
- <message_argument value="ExactMatch"/>
- <message_argument value="CDOBranchPoint"/>
- <message_argument value="Store"/>
- </message_arguments>
- </filter>
- </resource>
-</component>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.emf.cdo.server" version="2">
+ <resource path="src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java" type="org.eclipse.emf.cdo.internal.server.DelegatingRepository">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalRepository"/>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="DelegatingRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/LockingManager.java" type="org.eclipse.emf.cdo.internal.server.LockingManager$DurableView">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="DurableView"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="IView"/>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="DurableView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/QueryManager.java" type="org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="IQueryContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/Repository.java" type="org.eclipse.emf.cdo.internal.server.Repository">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOReplicationInfo"/>
+ <message_argument value="Repository"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalRepository"/>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="Repository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ResourcesQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.ResourcesQueryHandler$QueryContext">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryResourcesContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="ServerCDOView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java" type="org.eclipse.emf.cdo.internal.server.ServerCDOView$ServerCDOSession">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDORepositoryInfo"/>
+ <message_argument value="ServerCDOSession"/>
+ </message_arguments>
+ </filter>
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="InternalCDOSession"/>
+ <message_argument value="ServerCDOSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/Session.java" type="org.eclipse.emf.cdo.internal.server.Session">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalSession"/>
+ <message_argument value="CDOCommonSession"/>
+ <message_argument value="Session"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$DeltaLockWrapper">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOIDAndBranch"/>
+ <message_argument value="DeltaLockWrapper"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java" type="org.eclipse.emf.cdo.internal.server.TransactionCommitContext$XRefContext">
+ <filter id="572522506">
+ <message_arguments>
+ <message_argument value="CDOIDReference"/>
+ <message_argument value="XRefContext"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryXRefsContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="XRefContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/View.java" type="org.eclipse.emf.cdo.internal.server.View">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="View"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="InternalView"/>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="View"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/XRefsQueryHandler.java" type="org.eclipse.emf.cdo.internal.server.XRefsQueryHandler$QueryContext">
+ <filter id="572522506">
+ <message_arguments>
+ <message_argument value="CDOIDReference"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="QueryXRefsContext"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionConfiguration.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionConfiguration$RepositoryInfo">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDORepositoryInfo"/>
+ <message_argument value="RepositoryInfo"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedClientSessionProtocol">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOSessionProtocol"/>
+ <message_argument value="EmbeddedClientSessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java" type="org.eclipse.emf.cdo.internal.server.embedded.EmbeddedServerSessionProtocol">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="ISessionProtocol"/>
+ <message_argument value="CDOProtocol"/>
+ <message_argument value="EmbeddedServerSessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStore">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="DurableLocking"/>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="MEMStore"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java" type="org.eclipse.emf.cdo.internal.server.mem.MEMStoreAccessor">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="DurableLocking"/>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="MEMStoreAccessor"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java" type="org.eclipse.emf.cdo.internal.server.syncing.OfflineClone$CommitContextData">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommitData"/>
+ <message_argument value="CommitContextData"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IQueryContext.java" type="org.eclipse.emf.cdo.server.IQueryContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="IQueryContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IRepository.java" type="org.eclipse.emf.cdo.server.IRepository">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommonRepository"/>
+ <message_argument value="IRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/ISession.java" type="org.eclipse.emf.cdo.server.ISession">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="CDOCommonSession"/>
+ <message_argument value="ISession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$DurableLocking">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="DurableLocking"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryResourcesContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryResourcesContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IStoreAccessor.java" type="org.eclipse.emf.cdo.server.IStoreAccessor$QueryXRefsContext">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="QueryXRefsContext"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/ITransaction.java" type="org.eclipse.emf.cdo.server.ITransaction">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOCommonTransaction"/>
+ <message_argument value="ITransaction"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/IView.java" type="org.eclipse.emf.cdo.server.IView">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOCommonView"/>
+ <message_argument value="IView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSession.java" type="org.eclipse.emf.cdo.server.embedded.CDOSession">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOSession"/>
+ <message_argument value="CDOSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/server/embedded/CDOSessionConfiguration.java" type="org.eclipse.emf.cdo.server.embedded.CDOSessionConfiguration">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOSessionConfiguration"/>
+ <message_argument value="CDOSessionConfiguration"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/DurableLockArea.java" type="org.eclipse.emf.cdo.spi.server.DurableLockArea">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="LockArea"/>
+ <message_argument value="DurableLockArea"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java" type="org.eclipse.emf.cdo.spi.server.ISessionProtocol">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOProtocol"/>
+ <message_argument value="ISessionProtocol"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java" type="org.eclipse.emf.cdo.spi.server.InternalLockManager">
+ <filter id="574619656">
+ <message_arguments>
+ <message_argument value="IDurableLockingManager"/>
+ <message_argument value="InternalLockManager"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSession.java" type="org.eclipse.emf.cdo.spi.server.InternalSession">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="Options"/>
+ <message_argument value="InternalSession"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/InternalSynchronizableRepository.java" type="org.eclipse.emf.cdo.spi.server.InternalSynchronizableRepository">
+ <filter id="571473929">
+ <message_arguments>
+ <message_argument value="CDOReplicationContext"/>
+ <message_argument value="InternalSynchronizableRepository"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/emf/cdo/spi/server/Store.java" type="org.eclipse.emf.cdo.spi.server.Store">
+ <filter id="574660632">
+ <message_arguments>
+ <message_argument value="ExactMatch"/>
+ <message_argument value="CDOBranchPoint"/>
+ <message_argument value="Store"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java
index e01374b..0021f8b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/DelegatingRepository.java
@@ -101,9 +101,10 @@ public abstract class DelegatingRepository implements InternalRepository
return getDelegate().getListeners();
}
+ @Deprecated
public InternalLockManager getLockManager()
{
- return getDelegate().getLockManager();
+ return getDelegate().getLockingManager();
}
public String getName()
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockingManager.java
index 50a9180..287e152 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LockingManager.java
@@ -41,6 +41,7 @@ import org.eclipse.net4j.util.CheckUtil;
import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.collection.ConcurrentArray;
import org.eclipse.net4j.util.concurrent.RWOLockManager;
import org.eclipse.net4j.util.container.ContainerEventAdapter;
import org.eclipse.net4j.util.container.IContainer;
@@ -66,7 +67,7 @@ import java.util.Set;
* @author Simon McDuff
* @since 3.0
*/
-public class LockManager extends RWOLockManager<Object, IView> implements InternalLockManager
+public class LockingManager extends RWOLockManager<Object, IView> implements InternalLockManager
{
private InternalRepository repository;
@@ -74,6 +75,15 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
private Map<String, DurableView> durableViews = new HashMap<String, DurableView>();
+ private ConcurrentArray<DurableViewHandler> durableViewHandlers = new ConcurrentArray<DurableViewHandler>()
+ {
+ @Override
+ protected DurableViewHandler[] newArray(int length)
+ {
+ return new DurableViewHandler[length];
+ }
+ };
+
@ExcludeFromDump
private transient IListener sessionListener = new ContainerEventAdapter<IView>()
{
@@ -87,8 +97,10 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
}
else
{
- changeContext(view, new DurableView(durableLockingID));
+ DurableView durableView = new DurableView(durableLockingID);
+ changeContext(view, durableView);
unregisterOpenView(durableLockingID);
+ durableViews.put(durableLockingID, durableView);
}
}
};
@@ -109,7 +121,7 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
}
};
- public LockManager()
+ public LockingManager()
{
}
@@ -399,6 +411,18 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
throw new IllegalStateException("Durable read-only state does not match the request");
}
+ for (DurableViewHandler handler : durableViewHandlers.get())
+ {
+ try
+ {
+ handler.openingView(session, viewID, readOnly, area);
+ }
+ catch (Exception ex)
+ {
+ throw WrappedException.wrap(ex);
+ }
+ }
+
if (readOnly)
{
view = (InternalView)session.openView(viewID, area);
@@ -408,7 +432,8 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
view = (InternalView)session.openTransaction(viewID, area);
}
- changeContext(new DurableView(durableLockingID), view);
+ DurableView durableView = durableViews.get(durableLockingID);
+ changeContext(durableView, view);
view.setDurableLockingID(durableLockingID);
view.addListener(new LifecycleEventAdapter()
{
@@ -523,6 +548,16 @@ public class LockManager extends RWOLockManager<Object, IView> implements Intern
throw new ImplementationError("Unexpected lock object: " + key);
}
+ public void addDurableViewHandler(DurableViewHandler handler)
+ {
+ durableViewHandlers.add(handler);
+ }
+
+ public void removeDurableViewHandler(DurableViewHandler handler)
+ {
+ durableViewHandlers.remove(handler);
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 4798681..04730c7 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -175,7 +175,7 @@ public class Repository extends Container<Object> implements InternalRepository
private InternalCommitManager commitManager;
- private InternalLockManager lockManager;
+ private InternalLockManager lockingManager;
private IQueryHandlerProvider queryHandlerProvider;
@@ -780,19 +780,26 @@ public class Repository extends Container<Object> implements InternalRepository
/**
* @since 2.0
+ * @deprecated
*/
+ @Deprecated
public InternalLockManager getLockManager()
{
- return lockManager;
+ return getLockingManager();
+ }
+
+ public InternalLockManager getLockingManager()
+ {
+ return lockingManager;
}
/**
* @since 2.0
*/
- public void setLockManager(InternalLockManager lockManager)
+ public void setLockingManager(InternalLockManager lockingManager)
{
checkInactive();
- this.lockManager = lockManager;
+ this.lockingManager = lockingManager;
}
public InternalCommitContext createCommitContext(InternalTransaction transaction)
@@ -942,7 +949,7 @@ public class Repository extends Container<Object> implements InternalRepository
public Object[] getElements()
{
final Object[] elements = { packageRegistry, branchManager, revisionManager, sessionManager, queryManager,
- commitManager, commitInfoManager, lockManager, store };
+ commitManager, commitInfoManager, getLockingManager(), store };
return elements;
}
@@ -1163,7 +1170,7 @@ public class Repository extends Container<Object> implements InternalRepository
long startTime = context.getLastReplicatedCommitTime();
commitInfoManager.getCommitInfos(null, startTime + 1L, CDOBranchPoint.UNSPECIFIED_DATE, context);
- lockManager.getLockAreas(null, context);
+ getLockingManager().getLockAreas(null, context);
}
public CDOChangeSetData getChangeSet(CDOBranchPoint startPoint, CDOBranchPoint endPoint)
@@ -1379,7 +1386,7 @@ public class Repository extends Container<Object> implements InternalRepository
List<LockState<Object, IView>> newLockStates = null;
try
{
- newLockStates = lockManager.lock2(true, type, view, lockables, recursive, timeout);
+ newLockStates = getLockingManager().lock2(true, type, view, lockables, recursive, timeout);
}
catch (TimeoutRuntimeException ex)
{
@@ -1392,14 +1399,14 @@ public class Repository extends Container<Object> implements InternalRepository
long[] requiredTimestamp = { 0L };
CDORevisionKey[] staleRevisionsArray = null;
-
+
try
{
staleRevisionsArray = checkStaleRevisions(view, loadedRevs, lockables, type, requiredTimestamp);
}
catch (IllegalArgumentException e)
{
- lockManager.unlock2(true, type, view, lockables, recursive);
+ getLockingManager().unlock2(true, type, view, lockables, recursive);
throw e;
}
@@ -1410,7 +1417,7 @@ public class Repository extends Container<Object> implements InternalRepository
boolean staleNoUpdate = staleRevisionsArray.length > 0 && !session.isPassiveUpdateEnabled();
if (staleNoUpdate)
{
- lockManager.unlock2(true, type, view, lockables, recursive);
+ getLockingManager().unlock2(true, type, view, lockables, recursive);
return new LockObjectsResult(false, false, false, requiredTimestamp[0], staleRevisionsArray, new CDOLockState[0],
getTimeStamp());
}
@@ -1505,11 +1512,11 @@ public class Repository extends Container<Object> implements InternalRepository
List<LockState<Object, IView>> newLockStates = null;
if (lockType == null) // Signals an unlock-all operation
{
- newLockStates = lockManager.unlock2(true, view);
+ newLockStates = getLockingManager().unlock2(true, view);
}
else
{
- newLockStates = lockManager.unlock2(true, lockType, view, unlockables, recursive);
+ newLockStates = getLockingManager().unlock2(true, lockType, view, unlockables, recursive);
}
long timestamp = getTimeStamp();
@@ -1746,7 +1753,7 @@ public class Repository extends Container<Object> implements InternalRepository
checkState(queryManager, "queryManager"); //$NON-NLS-1$
checkState(commitInfoManager, "commitInfoManager"); //$NON-NLS-1$
checkState(commitManager, "commitManager"); //$NON-NLS-1$
- checkState(lockManager, "lockingManager"); //$NON-NLS-1$
+ checkState(getLockingManager(), "lockingManager"); //$NON-NLS-1$
packageRegistry.setReplacingDescriptors(true);
packageRegistry.setPackageProcessor(this);
@@ -1760,7 +1767,7 @@ public class Repository extends Container<Object> implements InternalRepository
queryManager.setRepository(this);
commitInfoManager.setCommitInfoLoader(this);
commitManager.setRepository(this);
- lockManager.setRepository(this);
+ getLockingManager().setRepository(this);
store.setRepository(this);
}
@@ -1816,13 +1823,13 @@ public class Repository extends Container<Object> implements InternalRepository
// }
}
- LifecycleUtil.activate(lockManager); // Needs an initialized main branch / branch manager
+ LifecycleUtil.activate(getLockingManager()); // Needs an initialized main branch / branch manager
}
@Override
protected void doDeactivate() throws Exception
{
- LifecycleUtil.deactivate(lockManager);
+ LifecycleUtil.deactivate(getLockingManager());
LifecycleUtil.deactivate(queryHandlerProvider);
LifecycleUtil.deactivate(commitManager);
LifecycleUtil.deactivate(commitInfoManager);
@@ -1885,7 +1892,7 @@ public class Repository extends Container<Object> implements InternalRepository
if (getLockManager() == null)
{
- setLockManager(createLockManager());
+ setLockingManager(createLockManager());
}
super.doBeforeActivate();
@@ -1926,9 +1933,15 @@ public class Repository extends Container<Object> implements InternalRepository
return new CommitManager();
}
+ @Deprecated
protected InternalLockManager createLockManager()
{
- return new LockManager();
+ return createLockingManager();
+ }
+
+ public LockingManager createLockingManager()
+ {
+ return new LockingManager();
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
index 62b785c..ce3a43a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
@@ -167,7 +167,7 @@ public class TransactionCommitContext implements InternalCommitContext
repository = transaction.getRepository();
revisionManager = repository.getRevisionManager();
- lockManager = repository.getLockManager();
+ lockManager = repository.getLockingManager();
ensuringReferentialIntegrity = repository.isEnsuringReferentialIntegrity();
repositoryPackageRegistry = repository.getPackageRegistry(false);
@@ -1059,7 +1059,7 @@ public class TransactionCommitContext implements InternalCommitContext
if (isAutoReleaseLocksEnabled())
{
- postCommitLockStates = repository.getLockManager().unlock2(true, transaction);
+ postCommitLockStates = repository.getLockingManager().unlock2(true, transaction);
if (!postCommitLockStates.isEmpty())
{
sendLockNotifications(postCommitLockStates);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOCommandProvider.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOCommandProvider.java
index 2bbb967..7b4b141 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOCommandProvider.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/CDOCommandProvider.java
@@ -283,7 +283,7 @@ public class CDOCommandProvider implements CommandProvider
@Override
protected void doExecute(IStoreAccessor accessor)
{
- repository.getLockManager().getLockAreas(userIDPrefix, new IDurableLockingManager.LockArea.Handler()
+ repository.getLockingManager().getLockAreas(userIDPrefix, new IDurableLockingManager.LockArea.Handler()
{
public boolean handleLockArea(LockArea area)
{
@@ -311,7 +311,7 @@ public class CDOCommandProvider implements CommandProvider
@Override
protected void doExecute(IStoreAccessor accessor)
{
- repository.getLockManager().deleteLockArea(durableLockingID);
+ repository.getLockingManager().deleteLockArea(durableLockingID);
}
}.execute(repository);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
index 859bc72..7d178c6 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
@@ -809,7 +809,7 @@ public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader, Du
LockArea area = getLockArea(durableLockingID);
Map<CDOID, LockGrade> locks = area.getLocks();
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
for (Object objectToLock : objectsToLock)
{
CDOID id = lockManager.getLockKeyID(objectToLock);
@@ -832,7 +832,7 @@ public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader, Du
LockArea area = getLockArea(durableLockingID);
Map<CDOID, LockGrade> locks = area.getLocks();
- InternalLockManager lockManager = getRepository().getLockManager();
+ InternalLockManager lockManager = getRepository().getLockingManager();
for (Object objectToUnlock : objectsToUnlock)
{
CDOID id = lockManager.getLockKeyID(objectToUnlock);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index a948344..7bbf2ef 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -197,7 +197,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
{
StoreThreadLocal.setSession(replicatorSession);
final List<String> areaIDs = new LinkedList<String>();
- getLockManager().getLockAreas(null, new LockArea.Handler()
+ getLockingManager().getLockAreas(null, new LockArea.Handler()
{
public boolean handleLockArea(LockArea area)
{
@@ -272,7 +272,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
CDOLockOwner owner = lockChangeInfo.getLockOwner();
String durableLockingID = owner.getDurableLockingID();
CDOBranch viewedBranch = lockChangeInfo.getBranch();
- InternalLockManager lockManager = getLockManager();
+ InternalLockManager lockManager = getLockingManager();
LockType lockType = lockChangeInfo.getLockType();
InternalView view = null;
@@ -316,7 +316,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
try
{
StoreThreadLocal.setSession(replicatorSession);
- getLockManager().updateLockArea(area);
+ getLockingManager().updateLockArea(area);
getSessionManager().sendLockNotification(null, CDOLockUtil.createLockChangeInfo());
return true;
@@ -384,7 +384,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
private void replicateRawReloadLocks()
{
- getLockManager().reloadLocks();
+ getLockingManager().reloadLocks();
}
private void replicateRawNotifyClients(long fromCommitTime, long toCommitTime)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ILockingManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ILockingManager.java
new file mode 100644
index 0000000..1db26ba
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ILockingManager.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Caspar De Groot - initial API and implementation
+ */
+package org.eclipse.emf.cdo.server;
+
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.lock.IDurableLockingManager;
+
+/**
+ * Manages all persistent aspects of durable CDO views and provides for vetoable
+ * {@link #addDurableViewHandler(ILockingManager.DurableViewHandler) interception} of the durable view resumption
+ * process.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+public interface ILockingManager extends IDurableLockingManager
+{
+ public void addDurableViewHandler(DurableViewHandler handler);
+
+ public void removeDurableViewHandler(DurableViewHandler handler);
+
+ /**
+ * A call-back interface primarily intended to allow implementers to prevent the view from being opened by throwing an
+ * exception. See {@link ILockingManager#addDurableViewHandler(DurableViewHandler)}.
+ *
+ * @author Caspar De Groot
+ * @since 4.1
+ */
+ public interface DurableViewHandler
+ {
+ public void openingView(CDOCommonSession session, int viewID, boolean readOnly, LockArea area) throws Exception;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
index 353dd4a..972edc7 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
@@ -75,10 +75,17 @@ public interface IRepository extends CDOCommonRepository, IQueryHandlerProvider,
/**
* @since 4.0
+ * @deprecated As of 4.1 use {@link #getLockingManager()}.
*/
+ @Deprecated
public IDurableLockingManager getLockManager();
/**
+ * @since 4.1
+ */
+ public ILockingManager getLockingManager();
+
+ /**
* @since 2.0
*/
public IQueryHandlerProvider getQueryHandlerProvider();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java
index fb4d730..3a31cd5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalLockManager.java
@@ -12,8 +12,8 @@ package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.lock.IDurableLockingManager;
import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
+import org.eclipse.emf.cdo.server.ILockingManager;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IView;
@@ -33,7 +33,7 @@ import java.util.Map;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface InternalLockManager extends IRWOLockManager<Object, IView>, IDurableLockingManager
+public interface InternalLockManager extends IRWOLockManager<Object, IView>, ILockingManager
{
public InternalRepository getRepository();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
index b9cb5cf..7250d5e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
@@ -100,8 +100,17 @@ public interface InternalRepository extends IRepository, PackageProcessor, Packa
public void setSessionManager(InternalSessionManager sessionManager);
+ /**
+ * @deprecated As of 4.1 use {@link #getLockingManager()}.
+ */
+ @Deprecated
public InternalLockManager getLockManager();
+ /**
+ * @since 4.1
+ */
+ public InternalLockManager getLockingManager();
+
public InternalQueryManager getQueryManager();
public void setQueryHandlerProvider(IQueryHandlerProvider queryHandlerProvider);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java
index 0355d0c..0dfa5ca 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerRestartTransactionTest.java
@@ -10,9 +10,13 @@
*/
package org.eclipse.emf.cdo.tests;
+import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockArea;
import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockAreaNotFoundException;
import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.server.ILockingManager;
import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.spi.server.InternalLockManager;
import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
@@ -361,4 +365,29 @@ public class LockingManagerRestartTransactionTest extends AbstractLockingTest
assertReadLock(true, company);
assertWriteLock(false, company);
}
+
+ public void testDurableViewHandler() throws Exception
+ {
+ Company company = getModel1Factory().createCompany();
+ resource.getContents().add(company);
+ transaction.commit();
+
+ writeLock(company);
+
+ String durableLockingID = transaction.enableDurableLocking(true);
+
+ InternalLockManager mgr = getRepository().getLockingManager();
+ final boolean[] gotCalled = new boolean[1];
+ mgr.addDurableViewHandler(new ILockingManager.DurableViewHandler()
+ {
+ public void openingView(CDOCommonSession session, int viewID, boolean readOnly, LockArea area)
+ {
+ gotCalled[0] = true;
+ }
+ });
+
+ restart(durableLockingID);
+
+ assertEquals(true, gotCalled[0]);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
index c5de678..77e3f65 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java
@@ -839,7 +839,7 @@ public class LockingManagerTest extends AbstractLockingTest
CDOObject cdoCompany = CDOUtil.getCDOObject(company);
readLock(company);
transaction.close();
- assertEquals(false, repo.getLockManager().hasLock(LockType.READ, view, cdoCompany.cdoID()));
+ assertEquals(false, repo.getLockingManager().hasLock(LockType.READ, view, cdoCompany.cdoID()));
}
public void testSessionClose() throws Exception
@@ -860,7 +860,7 @@ public class LockingManagerTest extends AbstractLockingTest
session.close();
sleep(100);
- assertEquals(false, repo.getLockManager().hasLock(LockType.READ, view, cdoCompany.cdoID()));
+ assertEquals(false, repo.getLockingManager().hasLock(LockType.READ, view, cdoCompany.cdoID()));
}
public void testBugzilla_270345() throws Exception
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/ConcurrentArray.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/ConcurrentArray.java
index 489550c..1497c07 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/ConcurrentArray.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/ConcurrentArray.java
@@ -18,6 +18,8 @@ public abstract class ConcurrentArray<E>
{
protected E[] elements;
+ private final E[] EMPTY = newArray(0);
+
public ConcurrentArray()
{
}
@@ -29,7 +31,7 @@ public abstract class ConcurrentArray<E>
public E[] get()
{
- return elements;
+ return elements == null ? EMPTY : elements;
}
public synchronized void add(E element)