summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-31 09:09:41 (EST)
committerEike Stepper2008-01-31 09:09:41 (EST)
commit87d1a92aafc7b056e5be90bd4db9018a6a010edc (patch)
treee47dea4352fd9854412ee0ea968a9a3fad126ce4
parent15285cc164163236f7efcc45ccc37e4fea9e7c2c (diff)
downloadcdo-87d1a92aafc7b056e5be90bd4db9018a6a010edc.zip
cdo-87d1a92aafc7b056e5be90bd4db9018a6a010edc.tar.gz
cdo-87d1a92aafc7b056e5be90bd4db9018a6a010edc.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/src/org/eclipse/emf/cdo/internal/server/Session.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CDOClientProtocol.java5
9 files changed, 31 insertions, 52 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index e4bc5eb..ab09f92 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -17,17 +17,17 @@ import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
import org.eclipse.emf.cdo.internal.server.protocol.InvalidationNotification;
-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.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.CDOProtocolView.Type;
+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.model.CDOClassRef;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.SessionCreationException;
import org.eclipse.emf.cdo.server.StoreUtil;
-import org.eclipse.emf.cdo.server.IView.Type;
import org.eclipse.net4j.internal.util.container.Container;
import org.eclipse.net4j.internal.util.lifecycle.LifecycleEventAdapter;
@@ -137,7 +137,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
}
else
{
- IView.Type viewType = getViewType(kind);
+ Type viewType = getViewType(kind);
View view = new View(this, viewID, viewType);
views.put(viewID, view);
fireElementAddedEvent(view);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
index 6254797..f9c22d5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
@@ -12,7 +12,7 @@
package org.eclipse.emf.cdo.internal.server;
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.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
index ff2a01c..5a62ddb 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java
@@ -10,36 +10,25 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
+import org.eclipse.emf.cdo.internal.protocol.CDOProtocolImpl;
import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
-import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.signal.SignalReactor;
/**
* @author Eike Stepper
*/
-public class CDOServerProtocol extends SignalProtocol
+public class CDOServerProtocol extends CDOProtocolImpl
{
- private Session session;
-
public CDOServerProtocol()
{
}
- public String getType()
- {
- return CDOProtocolConstants.PROTOCOL_NAME;
- }
-
+ @Override
public Session getSession()
{
- return session;
- }
-
- public void setSession(Session session)
- {
- this.session = session;
+ return (Session)super.getSession();
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
index b1a5ed4..c27029a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
@@ -12,8 +12,8 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
-import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
index d678089..52a77e9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java
@@ -10,13 +10,13 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.server.PackageManager;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.internal.server.SessionManager;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.protocol.id.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IRepositoryProvider;
@@ -56,10 +56,16 @@ public class OpenSessionIndication extends IndicationWithResponse
protected void indicating(ExtendedDataInputStream in) throws IOException
{
repositoryName = in.readString();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read repositoryName: {0}", repositoryName);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read repositoryName: {0}", repositoryName);
+ }
disableLegacyObjects = in.readBoolean();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read disableLegacyObjects: {0}", disableLegacyObjects);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read disableLegacyObjects: {0}", disableLegacyObjects);
+ }
}
@Override
@@ -72,7 +78,7 @@ public class OpenSessionIndication extends IndicationWithResponse
CDOServerProtocol serverProtocol = (CDOServerProtocol)getProtocol();
Session session = sessionManager.openSession(serverProtocol, disableLegacyObjects);
- serverProtocol.setSession(session);
+ serverProtocol.setInfraStructure(session);
writeSessionID(out, session);
writeRepositoryUUID(out, repository);
@@ -148,7 +154,7 @@ public class OpenSessionIndication extends IndicationWithResponse
out.writeString(p.getPackageURI());
out.writeBoolean(p.isDynamic());
- CDOIDRangeImpl.write(out, p.getMetaIDRange());
+ CDOIDUtil.writeRange(out, p.getMetaIDRange());
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
index d243221..6afab28 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
@@ -11,23 +11,16 @@
package org.eclipse.emf.cdo.server;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
+import org.eclipse.emf.cdo.protocol.CDOProtocolSession;
import org.eclipse.net4j.util.container.IContainer;
/**
* @author Eike Stepper
*/
-public interface ISession extends IContainer<IView>
+public interface ISession extends CDOProtocolSession, IContainer<IView>
{
public ISessionManager getSessionManager();
public CDOServerProtocol getProtocol();
-
- public int getSessionID();
-
- public boolean isDisableLegacyObjects();
-
- public IView[] getViews();
-
- public IView getView(int viewID);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
index c3f57f5..87ab5dc 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
-import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.id.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
index 1186860..bf3172a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IView.java
@@ -10,22 +10,12 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
+import org.eclipse.emf.cdo.protocol.CDOProtocolView;
+
/**
* @author Eike Stepper
*/
-public interface IView
+public interface IView extends CDOProtocolView
{
public ISession getSession();
-
- public int getViewID();
-
- public Type getViewType();
-
- /**
- * @author Eike Stepper
- */
- public enum Type
- {
- TRANSACTION, READONLY, AUDIT
- }
}
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 061be32..c998fbc 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,6 +10,7 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
+import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.internal.protocol.CDOProtocolImpl;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
@@ -40,9 +41,9 @@ public class CDOClientProtocol extends CDOProtocolImpl
protected void doBeforeActivate() throws Exception
{
super.doBeforeActivate();
- if (getInfraStructure() == null)
+ if (!(getInfraStructure() instanceof CDOSession))
{
- throw new IllegalStateException("session == null");
+ throw new IllegalStateException("No session");
}
}
}