summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-25 14:28:22 (EDT)
committerEike Stepper2007-07-25 14:28:22 (EDT)
commitb7678d8f0563d9e5f530bc6fa64e5ae26683cdaa (patch)
tree2422b98aa2cec46463f6b391a1e480e6352aaa59
parentb9a735c1df0480e2f5592ae87856abfe7dc0623b (diff)
downloadcdo-b7678d8f0563d9e5f530bc6fa64e5ae26683cdaa.zip
cdo-b7678d8f0563d9e5f530bc6fa64e5ae26683cdaa.tar.gz
cdo-b7678d8f0563d9e5f530bc6fa64e5ae26683cdaa.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java2
7 files changed, 45 insertions, 14 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 2ae1095..723d942 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -242,15 +242,15 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
this.resource = (CDOResourceImpl)resource;
}
- public void cdoInternalFinalizeRevision()
+ public void cdoInternalPostLoad()
{
- transferTargetToRevision();
+ transferRevisionToTarget();
+ cdoInternalSetState(CDOState.CLEAN);
}
- public void cdoInternalResolveRevision()
+ public void cdoInternalPostAttach()
{
- transferRevisionToTarget();
- cdoInternalSetState(CDOState.CLEAN);
+ // Do nothing
}
public InternalEObject cdoInternalInstance()
@@ -258,6 +258,11 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
return getTarget();
}
+ public void cdoInternalPreCommit()
+ {
+ transferTargetToRevision();
+ }
+
public EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID)
{
// TODO Implement method CDOAdapterImpl.cdoInternalDynamicFeature()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
index 6944de1..72d536d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOMetaImpl.java
@@ -119,12 +119,17 @@ public class CDOMetaImpl implements InternalCDOObject
throw new UnsupportedOperationException();
}
- public void cdoInternalFinalizeRevision()
+ public void cdoInternalPostLoad()
{
throw new UnsupportedOperationException();
}
- public void cdoInternalResolveRevision()
+ public void cdoInternalPostAttach()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void cdoInternalPreCommit()
{
throw new UnsupportedOperationException();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index ed0501d..b13f892 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -167,7 +167,12 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
this.resource = (CDOResourceImpl)resource;
}
- public void cdoInternalFinalizeRevision()
+ public void cdoInternalPostLoad()
+ {
+ // Do nothing
+ }
+
+ public void cdoInternalPostAttach()
{
if (TRACER.isEnabled())
{
@@ -197,7 +202,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
}
- public void cdoInternalResolveRevision()
+ public void cdoInternalPreCommit()
{
// Do nothing
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index 6897780..405a528 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -225,7 +225,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object data)
{
CDOTransactionImpl transaction = (CDOTransactionImpl)object.cdoView();
- object.cdoInternalFinalizeRevision();
+ object.cdoInternalPostAttach();
object.cdoInternalSetState(CDOState.NEW);
// Finalize content tree
@@ -332,7 +332,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
CDORevisionImpl revision = view.lookupRevision(id);
object.cdoInternalSetRevision(revision);
object.cdoInternalSetState(CDOState.CLEAN);
- object.cdoInternalResolveRevision();
+ object.cdoInternalPostLoad();
if (forWrite)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 3f8ff32..e8adcfa 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -121,6 +121,9 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
CDOPackageManagerImpl packageManager = session.getPackageManager();
newPackages = packageManager.getTransientPackages();
+ preCommit(newObjects);
+ preCommit(dirtyObjects);
+
IChannel channel = session.getChannel();
CommitTransactionResult result = new CommitTransactionRequest(channel, this).send();
@@ -231,6 +234,17 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
}
}
+ private void preCommit(Map objects)
+ {
+ if (!objects.isEmpty())
+ {
+ for (Object object : objects.values())
+ {
+ ((InternalCDOObject)object).cdoInternalPreCommit();
+ }
+ }
+ }
+
private void postCommit(Map objects, CommitTransactionResult result)
{
if (!objects.isEmpty())
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java
index f1f77ef..23004ba 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java
@@ -35,9 +35,11 @@ public interface InternalCDOObject extends CDOObject, InternalEObject
public void cdoInternalSetRevision(CDORevision revision);
- public void cdoInternalFinalizeRevision();
+ public void cdoInternalPostLoad();
- public void cdoInternalResolveRevision();
+ public void cdoInternalPostAttach();
+
+ public void cdoInternalPreCommit();
public InternalEObject cdoInternalInstance();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
index 42bc254..38cafa8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
@@ -51,7 +51,7 @@ final class ProxyResolverResource implements Resource
if (object instanceof CDOAdapterImpl)
{
CDOAdapterImpl adapter = (CDOAdapterImpl)object;
- adapter.cdoInternalResolveRevision();
+ adapter.cdoInternalPostLoad();
return adapter.getTarget();
}