summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-31 09:06:58 (EST)
committerEike Stepper2008-01-31 09:06:58 (EST)
commit15285cc164163236f7efcc45ccc37e4fea9e7c2c (patch)
treef12ab7b1fdcdd1ba00ae5eac2a84966b1707d3c3
parent41a602815264cbced116818284928e6f781dc8ab (diff)
downloadcdo-15285cc164163236f7efcc45ccc37e4fea9e7c2c.zip
cdo-15285cc164163236f7efcc45ccc37e4fea9e7c2c.tar.gz
cdo-15285cc164163236f7efcc45ccc37e4fea9e7c2c.tar.bz2
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java9
10 files changed, 41 insertions, 43 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
index f2a4fc1..10918e5 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalMappingStrategy.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.server.db.IClassMapping;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
index c871561..80f2fac 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java
@@ -61,7 +61,7 @@ public abstract class CDOServerIndication extends IndicationWithResponse
protected Session getSession()
{
- return getProtocol().getSession();
+ return (Session)getProtocol().getSession();
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
index 918baaf..0cecbfd 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
@@ -13,9 +13,9 @@ package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.internal.protocol.revision.DLRevisionHolder;
import org.eclipse.emf.cdo.internal.protocol.revision.LRURevisionHolder;
import org.eclipse.emf.cdo.internal.protocol.revision.LRURevisionList;
-import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.CDOIDProvider;
-import org.eclipse.emf.cdo.protocol.CDOIDUtil;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOIDProvider;
+import org.eclipse.emf.cdo.protocol.id.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionData;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
index 8e18aba..a59f03e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo;
+import org.eclipse.emf.cdo.protocol.CDOProtocolSession;
import org.eclipse.emf.cdo.util.CDOPackageRegistry;
import org.eclipse.net4j.channel.IChannel;
@@ -22,12 +23,8 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* @author Eike Stepper
*/
-public interface CDOSession extends IContainer<CDOView>
+public interface CDOSession extends CDOProtocolSession, IContainer<CDOView>
{
- public int getSessionID();
-
- public boolean isDisableLegacyObjects();
-
public void setDisableLegacyObjects(boolean disableLegacyObjects);
public int getReferenceChunkSize();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index ef0a4fa..a774bc2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -13,6 +13,7 @@
package org.eclipse.emf.cdo;
import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.protocol.CDOProtocolView;
import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -24,16 +25,12 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* @author Eike Stepper
*/
-public interface CDOView extends INotifier
+public interface CDOView extends CDOProtocolView, INotifier
{
public static final long UNSPECIFIED_DATE = CDORevision.UNSPECIFIED_DATE;
public static final int NO_PRELOAD = 1;
- public int getViewID();
-
- public Type getViewType();
-
public CDOSession getSession();
public ResourceSet getResourceSet();
@@ -72,12 +69,4 @@ public interface CDOView extends INotifier
public int reload(CDOObject... objects);
public void close();
-
- /**
- * @author Eike Stepper
- */
- public enum Type
- {
- TRANSACTION, READONLY, AUDIT
- }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
index dfa70ae..1d7268f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOAudit;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
-import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
import java.text.MessageFormat;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index c251c7a..60678cd 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -13,19 +13,19 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
import org.eclipse.emf.cdo.CDOView;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.CDOIDRange;
-import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.id.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.bundle.OM;
+import org.eclipse.emf.internal.cdo.protocol.CDOClientProtocol;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionRequest;
import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult;
import org.eclipse.emf.internal.cdo.protocol.QueryObjectTypesRequest;
@@ -203,6 +203,11 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
return channel;
}
+ public CDOClientProtocol getProtocol()
+ {
+ return (CDOClientProtocol)channel.getReceiveHandler();
+ }
+
public String getRepositoryName()
{
return repositoryName;
@@ -294,6 +299,19 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
return openAudit(createResourceSet(), timeStamp);
}
+ public CDOView getView(int viewID)
+ {
+ for (CDOViewImpl view : getViews())
+ {
+ if (view.getViewID() == viewID)
+ {
+ return view;
+ }
+ }
+
+ return null;
+ }
+
public CDOViewImpl[] getViews()
{
Collection<CDOViewImpl> values;
@@ -344,7 +362,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
long id1 = nextTemporaryID;
nextTemporaryID -= count + count;
long id2 = nextTemporaryID + 2;
- return CDOIDRangeImpl.create(id1, id2);
+ return CDOIDUtil.createRange(id1, id2);
}
public InternalEObject lookupMetaInstance(CDOID id)
@@ -397,7 +415,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
{
long count = registerMetaInstance((InternalEObject)ePackage, nextTemporaryID);
long newTempID = nextTemporaryID - 2L * count;
- CDOIDRange range = CDOIDRangeImpl.create(nextTemporaryID, newTempID + 2L);
+ CDOIDRange range = CDOIDUtil.createRange(nextTemporaryID, newTempID + 2L);
nextTemporaryID = newTempID;
return range;
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
index fd88398..1fe8659 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOFeatureAnalyzerModelBased.java
@@ -11,8 +11,8 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.analyzer;
-import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.internal.cdo.InternalCDOObject;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java
index afe99c3..061be32 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java
@@ -10,25 +10,20 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
+import org.eclipse.emf.cdo.internal.protocol.CDOProtocolImpl;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
-import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class CDOClientProtocol extends SignalProtocol
+public class CDOClientProtocol extends CDOProtocolImpl
{
public CDOClientProtocol()
{
}
- public String getType()
- {
- return CDOProtocolConstants.PROTOCOL_NAME;
- }
-
@Override
protected SignalReactor doCreateSignalReactor(short signalID)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
index 7188dd5..b21358e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
@@ -13,13 +13,12 @@ package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
-import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.CDOIDRange;
-import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.id.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
@@ -87,7 +86,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
for (CDOPackage newPackage : newPackages)
{
CDOIDRange oldRange = newPackage.getMetaIDRange();
- CDOIDRange newRange = CDOIDRangeImpl.read(in);
+ CDOIDRange newRange = CDOIDUtil.readRange(in);
((CDOPackageImpl)newPackage).setMetaIDRange(newRange);
for (long i = 0; i < oldRange.getCount(); i++)
{