summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-19 03:24:32 (EDT)
committerEike Stepper2007-07-19 03:24:32 (EDT)
commiteda9f65121d82b043f24287578c61cbfc41a3c53 (patch)
treed280770d4efdfb3e6f6a8291259dfd1f0709ec64
parent37f94699e792e5d4645274c86e6bae062e56df86 (diff)
downloadcdo-eda9f65121d82b043f24287578c61cbfc41a3c53.zip
cdo-eda9f65121d82b043f24287578c61cbfc41a3c53.tar.gz
cdo-eda9f65121d82b043f24287578c61cbfc41a3c53.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java19
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java62
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java58
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java18
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java38
6 files changed, 133 insertions, 92 deletions
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 aa169ae..59846d1 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
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -35,7 +36,7 @@ import org.eclipse.emf.internal.cdo.util.ModelUtil;
/**
* @author Eike Stepper
*/
-public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
+public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObject
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_OBJECT, CDOObjectImpl.class);
@@ -102,7 +103,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
return cdoState == CDOState.TRANSIENT || cdoState == CDOState.PREPARED_ATTACH;
}
- void setID(CDOID id)
+ public void setID(CDOID id)
{
if (id == null)
{
@@ -117,7 +118,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
this.id = id;
}
- void setState(CDOState state)
+ public void setState(CDOState state)
{
if (this.state != state)
{
@@ -130,7 +131,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
}
}
- void setAdapter(CDOViewImpl view)
+ public void setAdapter(CDOViewImpl view)
{
if (this instanceof CDOResourceImpl)
{
@@ -138,7 +139,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
}
}
- void setResource(CDOResourceImpl resource)
+ public void setResource(CDOResource resource)
{
if (this instanceof CDOResourceImpl)
{
@@ -150,17 +151,17 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
TRACER.format("Setting resource: {0}", resource);
}
- this.resource = resource;
+ this.resource = (CDOResourceImpl)resource;
}
- void setRevision(CDORevisionImpl revision)
+ public void setRevision(CDORevision revision)
{
if (TRACER.isEnabled())
{
TRACER.format("Setting revision: {0}", revision);
}
- this.revision = revision;
+ this.revision = (CDORevisionImpl)revision;
}
void initializeContainer(InternalEObject container, EStructuralFeature eContainingFeature)
@@ -203,7 +204,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements CDOObject
}
}
- void finalizeRevision()
+ public void finalizeRevision()
{
if (TRACER.isEnabled())
{
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 53c0f11..c77cbe2 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
@@ -1,8 +1,10 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOState;
+import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
+import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.util.TransportException;
@@ -60,7 +62,7 @@ public final class CDOStateMachine
}
}
- public void attach(CDOObjectImpl object, CDOResourceImpl resource, CDOViewImpl view)
+ public void attach(InternalCDOObject object, CDOResource resource, CDOViewImpl view)
{
if (TRACER.isEnabled())
{
@@ -79,13 +81,13 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.FINALIZE_ATTACH, resource, view);
}
- public void detach(CDOObjectImpl object, CDOResourceImpl resource, CDOViewImpl view)
+ public void detach(InternalCDOObject object, CDOResource resource, CDOViewImpl view)
{
// TODO Implement method CDOStateMachine.detach()
throw new UnsupportedOperationException("Not yet implemented");
}
- public void read(CDOObjectImpl object)
+ public void read(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
@@ -95,7 +97,7 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.READ, null, null);
}
- public void write(CDOObjectImpl object)
+ public void write(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
@@ -105,7 +107,7 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.WRITE, null, null);
}
- public void invalidate(CDOObjectImpl object, long timeStamp)
+ public void invalidate(InternalCDOObject object, long timeStamp)
{
if (TRACER.isEnabled())
{
@@ -115,7 +117,7 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.INVALIDATE, timeStamp, null);
}
- public void commit(CDOObjectImpl object, CommitTransactionResult result)
+ public void commit(InternalCDOObject object, CommitTransactionResult result)
{
if (TRACER.isEnabled())
{
@@ -125,7 +127,7 @@ public final class CDOStateMachine
INSTANCE.processEvent(object, Event.COMMIT, result, null);
}
- public void rollback(CDOObjectImpl object)
+ public void rollback(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
@@ -213,7 +215,7 @@ public final class CDOStateMachine
transitions[stateIndex][eventIndex] = transition;
}
- private void processEvent(CDOObjectImpl object, Event event, Object data1, Object data2)
+ private void processEvent(InternalCDOObject object, Event event, Object data1, Object data2)
{
CDOState state = object.cdoState();
int stateIndex = state.ordinal();
@@ -247,7 +249,7 @@ public final class CDOStateMachine
*/
private static abstract class Transition
{
- public void execute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ public void execute(InternalCDOObject object, Event event, Object data1, Object data2)
{
if (TRACER.isEnabled())
{
@@ -262,7 +264,7 @@ public final class CDOStateMachine
return "Processing event {0} in state {1} for {2}";
}
- protected abstract void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2);
+ protected abstract void doExecute(InternalCDOObject object, Event event, Object data1, Object data2);
}
/**
@@ -277,7 +279,7 @@ public final class CDOStateMachine
}
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
}
}
@@ -288,7 +290,7 @@ public final class CDOStateMachine
private static final class FailTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
throw new IllegalStateException("Event " + event + " not allowed in state " + object.cdoState() + " for "
+ object);
@@ -301,7 +303,7 @@ public final class CDOStateMachine
private static final class AttachTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
CDOResourceImpl resource = (CDOResourceImpl)data1;
CDOViewImpl view = (CDOViewImpl)data2;
@@ -315,7 +317,7 @@ public final class CDOStateMachine
object.setState(CDOState.PREPARED_ATTACH);
// Create new revision
- CDORevisionImpl revision = new CDORevisionImpl(object.cdoClass(), id);
+ CDORevisionImpl revision = new CDORevisionImpl((CDOClassImpl)object.cdoClass(), id);
revision.setVersion(1);
revision.setResourceID(resource.cdoID());
object.setRevision(revision);
@@ -327,9 +329,9 @@ public final class CDOStateMachine
// Prepare content tree
for (EObject content : object.eContents())
{
- if (content instanceof CDOObjectImpl)
+ if (content instanceof InternalCDOObject)
{
- INSTANCE.processEvent((CDOObjectImpl)content, Event.ATTACH, resource, view);
+ INSTANCE.processEvent((InternalCDOObject)content, Event.ATTACH, resource, view);
}
}
}
@@ -341,7 +343,7 @@ public final class CDOStateMachine
private static final class FinalizeAttachTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
object.finalizeRevision();
object.setState(CDOState.NEW);
@@ -349,9 +351,9 @@ public final class CDOStateMachine
// Prepare content tree
for (EObject content : object.eContents())
{
- if (content instanceof CDOObjectImpl)
+ if (content instanceof InternalCDOObject)
{
- INSTANCE.processEvent((CDOObjectImpl)content, Event.FINALIZE_ATTACH, null, null);
+ INSTANCE.processEvent((InternalCDOObject)content, Event.FINALIZE_ATTACH, null, null);
}
}
}
@@ -363,7 +365,7 @@ public final class CDOStateMachine
private static final class DetachTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
// TODO Implement method DetachTransition.execute()
throw new UnsupportedOperationException("Not yet implemented");
@@ -376,9 +378,9 @@ public final class CDOStateMachine
private static final class CommitTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
- CDOViewImpl view = object.cdoView();
+ CDOViewImpl view = (CDOViewImpl)object.cdoView();
CommitTransactionResult result = (CommitTransactionResult)data1;
Map<CDOID, CDOID> idMappings = result.getIdMappings();
@@ -393,7 +395,7 @@ public final class CDOStateMachine
}
// Adjust revision
- CDORevisionImpl revision = object.cdoRevision();
+ CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
revision.setID(id);
revision.setCreated(result.getTimeStamp());
revision.adjustReferences(idMappings);
@@ -409,12 +411,12 @@ public final class CDOStateMachine
private static final class WriteTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
CDORevisionImpl revision = object.copyRevision();
revision.increaseVersion();
- CDOViewImpl view = object.cdoView();
+ CDOViewImpl view = (CDOViewImpl)object.cdoView();
CDOTransactionImpl transaction = getTransaction(view);
transaction.registerDirty(object);
@@ -428,10 +430,10 @@ public final class CDOStateMachine
private static final class InvalidateTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
long timeStamp = (Long)data1;
- object.cdoRevision().setRevised(timeStamp - 1);
+ ((CDORevisionImpl)object.cdoRevision()).setRevised(timeStamp - 1);
object.setState(CDOState.PROXY);
}
}
@@ -449,10 +451,10 @@ public final class CDOStateMachine
}
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
CDOID id = object.cdoID();
- CDOViewImpl view = object.cdoView();
+ CDOViewImpl view = (CDOViewImpl)object.cdoView();
CDORevisionImpl revision = view.getRevision(id);
object.setRevision(revision);
object.setState(CDOState.CLEAN);
@@ -470,7 +472,7 @@ public final class CDOStateMachine
private static final class LoadResourceTransition extends Transition
{
@Override
- protected void doExecute(CDOObjectImpl object, Event event, Object data1, Object data2)
+ protected void doExecute(InternalCDOObject object, Event event, Object data1, Object data2)
{
CDOResourceImpl resource = (CDOResourceImpl)data1;
CDOViewImpl view = (CDOViewImpl)data2;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 79b5512..bdb6c58 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -44,7 +44,7 @@ public final class CDOStore implements EStore
public InternalEObject getContainer(InternalEObject eObject)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
if (TRACER.isEnabled())
{
TRACER.format("getContainer({0})", cdoObject);
@@ -57,7 +57,7 @@ public final class CDOStore implements EStore
public int getContainingFeatureID(InternalEObject eObject)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
if (TRACER.isEnabled())
{
TRACER.format("getContainingFeatureID({0})", cdoObject);
@@ -69,7 +69,7 @@ public final class CDOStore implements EStore
public void setContainer(InternalEObject eObject, InternalEObject newContainer, int newContainerFeatureID)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
if (TRACER.isEnabled())
{
TRACER.format("setContainer({0}, {1}, {2})", cdoObject, newContainer, newContainerFeatureID);
@@ -89,7 +89,7 @@ public final class CDOStore implements EStore
public Object get(InternalEObject eObject, EStructuralFeature eFeature, int index)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -108,7 +108,7 @@ public final class CDOStore implements EStore
public boolean isSet(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -121,7 +121,7 @@ public final class CDOStore implements EStore
public int size(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -134,7 +134,7 @@ public final class CDOStore implements EStore
public boolean isEmpty(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -147,7 +147,7 @@ public final class CDOStore implements EStore
public boolean contains(InternalEObject eObject, EStructuralFeature eFeature, Object value)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -165,7 +165,7 @@ public final class CDOStore implements EStore
public int indexOf(InternalEObject eObject, EStructuralFeature eFeature, Object value)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -183,7 +183,7 @@ public final class CDOStore implements EStore
public int lastIndexOf(InternalEObject eObject, EStructuralFeature eFeature, Object value)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -201,7 +201,7 @@ public final class CDOStore implements EStore
public int hashCode(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -214,7 +214,7 @@ public final class CDOStore implements EStore
public Object[] toArray(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -242,7 +242,7 @@ public final class CDOStore implements EStore
public Object set(InternalEObject eObject, EStructuralFeature eFeature, int index, Object value)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -271,7 +271,7 @@ public final class CDOStore implements EStore
public void unset(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -284,7 +284,7 @@ public final class CDOStore implements EStore
public void add(InternalEObject eObject, EStructuralFeature eFeature, int index, Object value)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -307,7 +307,7 @@ public final class CDOStore implements EStore
public Object remove(InternalEObject eObject, EStructuralFeature eFeature, int index)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -326,7 +326,7 @@ public final class CDOStore implements EStore
public void clear(InternalEObject eObject, EStructuralFeature eFeature)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -339,7 +339,7 @@ public final class CDOStore implements EStore
public Object move(InternalEObject eObject, EStructuralFeature eFeature, int target, int source)
{
- CDOObjectImpl cdoObject = (CDOObjectImpl)eObject;
+ InternalCDOObject cdoObject = (InternalCDOObject)eObject;
CDOFeatureImpl cdoFeature = getCDOFeature(cdoObject, eFeature);
if (TRACER.isEnabled())
{
@@ -411,9 +411,9 @@ public final class CDOStore implements EStore
return potentialID;
}
- private static CDOFeatureImpl getCDOFeature(CDOObjectImpl cdoObject, EStructuralFeature eFeature)
+ private static CDOFeatureImpl getCDOFeature(InternalCDOObject cdoObject, EStructuralFeature eFeature)
{
- CDOViewImpl view = cdoObject.cdoView();
+ CDOViewImpl view = (CDOViewImpl)cdoObject.cdoView();
if (view == null)
{
throw new IllegalStateException("view == null");
@@ -423,21 +423,21 @@ public final class CDOStore implements EStore
return ModelUtil.getCDOFeature(eFeature, packageManager);
}
- private static CDORevisionImpl getRevisionForReading(CDOObjectImpl cdoObject)
+ private static CDORevisionImpl getRevisionForReading(InternalCDOObject cdoObject)
{
CDOStateMachine.INSTANCE.read(cdoObject);
return getRevision(cdoObject);
}
- private static CDORevisionImpl getRevisionForWriting(CDOObjectImpl cdoObject)
+ private static CDORevisionImpl getRevisionForWriting(InternalCDOObject cdoObject)
{
CDOStateMachine.INSTANCE.write(cdoObject);
return getRevision(cdoObject);
}
- private static CDORevisionImpl getRevision(CDOObjectImpl cdoObject)
+ private static CDORevisionImpl getRevision(InternalCDOObject cdoObject)
{
- CDORevisionImpl revision = cdoObject.cdoRevision();
+ CDORevisionImpl revision = (CDORevisionImpl)cdoObject.cdoRevision();
if (revision == null)
{
throw new IllegalStateException("revision == null");
@@ -446,12 +446,12 @@ public final class CDOStore implements EStore
return revision;
}
- private static void handleContainmentAdd(CDOObjectImpl cdoObject, CDOFeatureImpl cdoFeature, Object value)
+ private static void handleContainmentAdd(InternalCDOObject cdoObject, CDOFeatureImpl cdoFeature, Object value)
{
- CDOObjectImpl container = cdoObject;
- CDOObjectImpl contained = (CDOObjectImpl)value;
- CDOViewImpl containerView = container.cdoView();
- CDOViewImpl containedView = contained.cdoView();
+ InternalCDOObject container = cdoObject;
+ InternalCDOObject contained = (InternalCDOObject)value;
+ CDOViewImpl containerView = (CDOViewImpl)container.cdoView();
+ CDOViewImpl containedView = (CDOViewImpl)contained.cdoView();
if (containedView != containerView)
{
if (containedView != null)
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 642bc60..a8fb2b2 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
@@ -45,9 +45,9 @@ public class CDOTransactionImpl
private Map<CDOID, CDOResourceImpl> newResources = new HashMap();
- private Map<CDOID, CDOObjectImpl> newObjects = new HashMap();
+ private Map<CDOID, InternalCDOObject> newObjects = new HashMap();
- private Map<CDOID, CDOObjectImpl> dirtyObjects = new HashMap();
+ private Map<CDOID, InternalCDOObject> dirtyObjects = new HashMap();
private boolean dirty;
@@ -76,12 +76,12 @@ public class CDOTransactionImpl
return newResources;
}
- public Map<CDOID, CDOObjectImpl> getNewObjects()
+ public Map<CDOID, InternalCDOObject> getNewObjects()
{
return newObjects;
}
- public Map<CDOID, CDOObjectImpl> getDirtyObjects()
+ public Map<CDOID, InternalCDOObject> getDirtyObjects()
{
return dirtyObjects;
}
@@ -166,7 +166,7 @@ public class CDOTransactionImpl
}
}
- public void registerNew(CDOObjectImpl object)
+ public void registerNew(InternalCDOObject object)
{
if (object instanceof CDOResourceImpl)
{
@@ -188,7 +188,7 @@ public class CDOTransactionImpl
}
}
- public void registerDirty(CDOObjectImpl object)
+ public void registerDirty(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
@@ -198,7 +198,7 @@ public class CDOTransactionImpl
register(dirtyObjects, object);
}
- private void register(Map map, CDOObjectImpl object)
+ private void register(Map map, InternalCDOObject object)
{
Object old = map.put(object.cdoID(), object);
if (old != null)
@@ -219,7 +219,7 @@ public class CDOTransactionImpl
{
for (Object object : objects.values())
{
- CDOStateMachine.INSTANCE.commit((CDOObjectImpl)object, result);
+ CDOStateMachine.INSTANCE.commit((InternalCDOObject)object, result);
}
}
}
@@ -236,7 +236,7 @@ public class CDOTransactionImpl
//
// Set<String> knownPackages = session.getPackageURIs();
// Map<String, CDOPackageImpl> newPackages = new HashMap();
- // for (CDOObjectImpl cdoObject : newObjects.values())
+ // for (InternalCDOObject cdoObject : newObjects.values())
// {
// CDOPackageImpl cdoPackage = cdoObject.cdoClass().getContainingPackage();
// String uri = cdoPackage.getPackageURI();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 28e174a..5db6246 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -68,11 +68,11 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
private CDOTransactionImpl transaction;
- private Map<CDOID, CDOObjectImpl> objects = new HashMap();
+ private Map<CDOID, InternalCDOObject> objects = new HashMap();
private CDOID lastLookupID;
- private CDOObjectImpl lastLookupObject;
+ private InternalCDOObject lastLookupObject;
public CDOViewImpl(int id, CDOSessionImpl session, boolean readOnly)
{
@@ -174,7 +174,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
resource.setResourceSet(resourceSet);
resource.setPath(path);
- CDOObjectImpl resourceObject = resource;
+ InternalCDOObject resourceObject = resource;
resourceObject.setID(resourceID);
resourceObject.setAdapter(this);
resourceObject.setResource(resource);
@@ -192,12 +192,12 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
}
- public CDOObjectImpl newInstance(EClass eClass)
+ public InternalCDOObject newInstance(EClass eClass)
{
- return (CDOObjectImpl)EcoreUtil.create(eClass);
+ return (InternalCDOObject)EcoreUtil.create(eClass);
}
- public CDOObjectImpl newInstance(CDOClass cdoClass)
+ public InternalCDOObject newInstance(CDOClass cdoClass)
{
EClass eClass = ModelUtil.getEClass((CDOClassImpl)cdoClass, session.getPackageRegistry());
if (eClass == null)
@@ -237,28 +237,28 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return lastLookupObject;
}
- public void registerObject(CDOObjectImpl object)
+ public void registerObject(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
TRACER.format("Registering object {0}", object);
}
- CDOObjectImpl old = objects.put(object.cdoID(), object);
+ InternalCDOObject old = objects.put(object.cdoID(), object);
if (old != null)
{
throw new IllegalStateException("Duplicate ID: " + object);
}
}
- public void deregisterObject(CDOObjectImpl object)
+ public void deregisterObject(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
TRACER.format("Deregistering object {0}", object);
}
- CDOObjectImpl old = objects.remove(object.cdoID());
+ InternalCDOObject old = objects.remove(object.cdoID());
if (old == null)
{
throw new IllegalStateException("Unknown ID: " + object);
@@ -267,7 +267,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
public void remapObject(CDOID oldID)
{
- CDOObjectImpl object = objects.remove(oldID);
+ InternalCDOObject object = objects.remove(oldID);
CDOID newID = object.cdoID();
objects.put(newID, object);
if (TRACER.isEnabled())
@@ -298,7 +298,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
for (CDOID dirtyOID : dirtyOIDs)
{
- CDOObjectImpl object = objects.get(dirtyOID);
+ InternalCDOObject object = objects.get(dirtyOID);
if (object != null)
{
CDOStateMachine.INSTANCE.invalidate(object, timeStamp);
@@ -455,7 +455,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
try
{
- ((CDOObjectImpl)cdoResource).setState(CDOState.NEW);
+ ((InternalCDOObject)cdoResource).setState(CDOState.NEW);
resourceSet.getResources().remove(cdoResource);
}
catch (RuntimeException ignore)
@@ -497,7 +497,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
fireEvent(new ResourcesEvent(cdoResource.getPath(), ResourcesEvent.Kind.REMOVED));
}
- private CDOObjectImpl createObject(CDOID id)
+ private InternalCDOObject createObject(CDOID id)
{
if (TRACER.isEnabled())
{
@@ -508,7 +508,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
CDOClassImpl cdoClass = revision.getCDOClass();
CDOID resourceID = revision.getResourceID();
- CDOObjectImpl object = newInstance(cdoClass);
+ InternalCDOObject object = newInstance(cdoClass);
if (object instanceof CDOResourceImpl)
{
object.setResource((CDOResourceImpl)object);
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
new file mode 100644
index 0000000..97870b0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOObject.java
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ **************************************************************************/
+package org.eclipse.emf.internal.cdo;
+
+import org.eclipse.emf.cdo.CDOObject;
+import org.eclipse.emf.cdo.CDOState;
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+
+/**
+ * @author Eike Stepper
+ */
+public interface InternalCDOObject extends CDOObject
+{
+ public void setID(CDOID id);
+
+ public void setResource(CDOResource resource);
+
+ public void setAdapter(CDOViewImpl view);
+
+ public void setState(CDOState prepared_attach);
+
+ public void setRevision(CDORevision revision);
+
+ public CDORevisionImpl copyRevision();
+
+ public void finalizeRevision();
+}