summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-06 12:13:18 (EDT)
committerEike Stepper2007-07-06 12:13:18 (EDT)
commit1f5ddf4721a15bc9a0b755b9a1352a6f757fae62 (patch)
tree62c9ea5ab434110872e2e027b5757c57601483b0
parent3f16c0f3d2dc3aa9f7483672d13f8ba5f0f8dfca (diff)
downloadcdo-1f5ddf4721a15bc9a0b755b9a1352a6f757fae62.zip
cdo-1f5ddf4721a15bc9a0b755b9a1352a6f757fae62.tar.gz
cdo-1f5ddf4721a15bc9a0b755b9a1352a6f757fae62.tar.bz2
task 1: Develop 0.8.0
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryImpl.java)32
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManagerImpl.java)16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManagerImpl.java)16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java)14
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionImpl.java)10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManagerImpl.java)28
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java45
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerIndication.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOServerProtocol.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Repository.java)10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IResourceManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ResourceManager.java)6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRevisionManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RevisionManager.java)4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Session.java)4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/SessionManager.java)8
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreManager.java (renamed from plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RepositoryManager.java)17
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java19
24 files changed, 339 insertions, 105 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java
new file mode 100644
index 0000000..b19de75
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreManager.java
@@ -0,0 +1,40 @@
+/***************************************************************************
+ * 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.cdo.internal.server;
+
+import org.eclipse.emf.cdo.server.IStoreTransaction;
+
+/**
+ * @author Eike Stepper
+ */
+public class EmptyStoreManager extends StoreManager
+{
+ private static final String STORE_TYPE = "EMPTY";
+
+ public EmptyStoreManager()
+ {
+ super(STORE_TYPE);
+ setInstanceID(STORE_TYPE);
+ }
+
+ public IStoreTransaction startTransaction()
+ {
+ return new EmptyStoreTransaction(this);
+ }
+
+ public void commitTransaction(IStoreTransaction transaction)
+ {
+ }
+
+ public void rollbackTransaction(IStoreTransaction transaction)
+ {
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java
new file mode 100644
index 0000000..44ac32a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/EmptyStoreTransaction.java
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * 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.cdo.internal.server;
+
+
+/**
+ * @author Eike Stepper
+ */
+public class EmptyStoreTransaction extends StoreTransaction
+{
+ public EmptyStoreTransaction(StoreManager store)
+ {
+ super(store);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 0f51427..a920cb0 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -12,14 +12,15 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.server.Repository;
+import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.IStoreManager;
import java.util.UUID;
/**
* @author Eike Stepper
*/
-public class RepositoryImpl implements Repository
+public class Repository implements IRepository
{
private static final long INITIAL_OID_VALUE = 1;
@@ -27,21 +28,23 @@ public class RepositoryImpl implements Repository
private String uuid;
- private SessionManagerImpl sessionManager;
+ private SessionManager sessionManager;
- private ResourceManagerImpl resourceManager;
+ private ResourceManager resourceManager;
- private RevisionManagerImpl revisionManager;
+ private RevisionManager revisionManager;
+
+ private IStoreManager storeManager;
private long nextOIDValue = INITIAL_OID_VALUE;
- public RepositoryImpl(String name)
+ public Repository(String name)
{
this.name = name;
this.uuid = UUID.randomUUID().toString();
- sessionManager = new SessionManagerImpl(this);
- resourceManager = new ResourceManagerImpl(this);
- revisionManager = new RevisionManagerImpl(this);
+ sessionManager = new SessionManager(this);
+ resourceManager = new ResourceManager(this);
+ revisionManager = new RevisionManager(this);
}
public String getName()
@@ -54,21 +57,26 @@ public class RepositoryImpl implements Repository
return uuid;
}
- public SessionManagerImpl getSessionManager()
+ public SessionManager getSessionManager()
{
return sessionManager;
}
- public ResourceManagerImpl getResourceManager()
+ public ResourceManager getResourceManager()
{
return resourceManager;
}
- public RevisionManagerImpl getRevisionManager()
+ public RevisionManager getRevisionManager()
{
return revisionManager;
}
+ public IStoreManager getStoreManager()
+ {
+ return storeManager;
+ }
+
public CDOID getNextCDOID()
{
return CDOIDImpl.create(nextOIDValue++);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManager.java
index 6b2777f..c9cdd1e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RepositoryManager.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.server.RepositoryManager;
+import org.eclipse.emf.cdo.server.IRepositoryManager;
import java.util.HashMap;
import java.util.Map;
@@ -18,23 +18,23 @@ import java.util.Map;
/**
* @author Eike Stepper
*/
-public final class RepositoryManagerImpl implements RepositoryManager
+public final class RepositoryManager implements IRepositoryManager
{
// @Singleton
- public static final RepositoryManagerImpl INSTANCE = new RepositoryManagerImpl();
+ public static final RepositoryManager INSTANCE = new RepositoryManager();
- private Map<String, RepositoryImpl> repositories = new HashMap();
+ private Map<String, Repository> repositories = new HashMap();
- private RepositoryManagerImpl()
+ private RepositoryManager()
{
}
- public RepositoryImpl getRepository(String name, boolean createOnDemand)
+ public Repository getRepository(String name, boolean createOnDemand)
{
- RepositoryImpl repository = repositories.get(name);
+ Repository repository = repositories.get(name);
if (repository == null && createOnDemand)
{
- repository = new RepositoryImpl(name);
+ repository = new Repository(name);
repositories.put(name, repository);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java
index d80a06f..412bbf0 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ResourceManager.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.server.bundle.CDOServer;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.server.ResourceManager;
+import org.eclipse.emf.cdo.server.IResourceManager;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -22,22 +22,22 @@ import java.util.Map;
/**
* @author Eike Stepper
*/
-public class ResourceManagerImpl implements ResourceManager
+public class ResourceManager implements IResourceManager
{
- private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManagerImpl.class);
+ private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManager.class);
- private RepositoryImpl repository;
+ private Repository repository;
private Map<CDOID, String> idToPathMap = new HashMap();
private Map<String, CDOID> pathToIDMap = new HashMap();
- public ResourceManagerImpl(RepositoryImpl repository)
+ public ResourceManager(Repository repository)
{
this.repository = repository;
}
- public RepositoryImpl getRepository()
+ public Repository getRepository()
{
return repository;
}
@@ -82,13 +82,13 @@ public class ResourceManagerImpl implements ResourceManager
private CDOID loadID(String path)
{
- // TODO Implement method ResourceManagerImpl.loadID()
+ // TODO Implement method ResourceManager.loadID()
throw new UnsupportedOperationException("Not yet implemented");
}
private String loadPath(CDOID id)
{
- // TODO Implement method ResourceManagerImpl.loadPath()
+ // TODO Implement method ResourceManager.loadPath()
throw new UnsupportedOperationException("Not yet implemented");
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
index 25fae0d..ecd4f1e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
@@ -14,21 +14,21 @@ import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOPathFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.server.RevisionManager;
+import org.eclipse.emf.cdo.server.IRevisionManager;
/**
* @author Eike Stepper
*/
-public class RevisionManagerImpl extends CDORevisionResolverImpl implements RevisionManager
+public class RevisionManager extends CDORevisionResolverImpl implements IRevisionManager
{
- private RepositoryImpl repository;
+ private Repository repository;
- public RevisionManagerImpl(RepositoryImpl repository)
+ public RevisionManager(Repository repository)
{
this.repository = repository;
}
- public RepositoryImpl getRepository()
+ public Repository getRepository()
{
return repository;
}
@@ -47,14 +47,14 @@ public class RevisionManagerImpl extends CDORevisionResolverImpl implements Revi
@Override
protected CDORevisionImpl loadRevision(CDOID id)
{
- // TODO Implement method RevisionManagerImpl.loadRevision()
+ // TODO Implement method RevisionManager.loadRevision()
throw new UnsupportedOperationException("Not yet implemented");
}
@Override
protected CDORevisionImpl loadRevision(CDOID id, long timeStamp)
{
- // TODO Implement method RevisionManagerImpl.loadRevision()
+ // TODO Implement method RevisionManager.loadRevision()
throw new UnsupportedOperationException("Not yet implemented");
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index 4739b2d..ec4387c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -14,27 +14,27 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.bundle.CDOServer;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
import org.eclipse.emf.cdo.internal.server.protocol.InvalidationRequest;
-import org.eclipse.emf.cdo.server.Session;
+import org.eclipse.emf.cdo.server.ISession;
/**
* @author Eike Stepper
*/
-public class SessionImpl implements Session
+public class Session implements ISession
{
- private SessionManagerImpl sessionManager;
+ private SessionManager sessionManager;
private CDOServerProtocol protocol;
private int sessionID;
- public SessionImpl(SessionManagerImpl sessionManager, CDOServerProtocol protocol, int sessionID)
+ public Session(SessionManager sessionManager, CDOServerProtocol protocol, int sessionID)
{
this.sessionManager = sessionManager;
this.protocol = protocol;
this.sessionID = sessionID;
}
- public SessionManagerImpl getSessionManager()
+ public SessionManager getSessionManager()
{
return sessionManager;
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManagerImpl.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index 9a7e7ee..d299f99 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.bundle.CDOServer;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
-import org.eclipse.emf.cdo.server.SessionManager;
+import org.eclipse.emf.cdo.server.ISessionManager;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -23,35 +23,35 @@ import java.util.Map;
/**
* @author Eike Stepper
*/
-public class SessionManagerImpl implements SessionManager
+public class SessionManager implements ISessionManager
{
- private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManagerImpl.class);
+ private static final ContextTracer TRACER = new ContextTracer(CDOServer.DEBUG_SESSION, SessionManager.class);
- private RepositoryImpl repository;
+ private Repository repository;
- private Map<Integer, SessionImpl> sessions = new HashMap();
+ private Map<Integer, Session> sessions = new HashMap();
private int lastSessionID;
- public SessionManagerImpl(RepositoryImpl repository)
+ public SessionManager(Repository repository)
{
this.repository = repository;
}
- public RepositoryImpl getRepository()
+ public Repository getRepository()
{
return repository;
}
- public SessionImpl[] getSessions()
+ public Session[] getSessions()
{
synchronized (sessions)
{
- return sessions.values().toArray(new SessionImpl[sessions.size()]);
+ return sessions.values().toArray(new Session[sessions.size()]);
}
}
- public SessionImpl openSession(CDOServerProtocol protocol)
+ public Session openSession(CDOServerProtocol protocol)
{
int id = ++lastSessionID;
if (TRACER.isEnabled())
@@ -59,7 +59,7 @@ public class SessionManagerImpl implements SessionManager
TRACER.trace("Opening session " + id);
}
- SessionImpl session = new SessionImpl(this, protocol, id);
+ Session session = new Session(this, protocol, id);
synchronized (sessions)
{
sessions.put(id, session);
@@ -68,13 +68,13 @@ public class SessionManagerImpl implements SessionManager
return session;
}
- public void sessionClosed(SessionImpl session)
+ public void sessionClosed(Session session)
{
}
- public void notifyInvalidation(long timeStamp, CDORevisionImpl[] dirtyObjects, SessionImpl excludedSession)
+ public void notifyInvalidation(long timeStamp, CDORevisionImpl[] dirtyObjects, Session excludedSession)
{
- for (SessionImpl session : getSessions())
+ for (Session session : getSessions())
{
if (session != excludedSession)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.java
new file mode 100644
index 0000000..e295525
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreException.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.cdo.internal.server;
+
+/**
+ * @author Eike Stepper
+ */
+public class StoreException extends RuntimeException
+{
+ private static final long serialVersionUID = 1L;
+
+ public StoreException()
+ {
+ }
+
+ public StoreException(String message)
+ {
+ super(message);
+ }
+
+ public StoreException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public StoreException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java
new file mode 100644
index 0000000..bdb7d71
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreManager.java
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * 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.cdo.internal.server;
+
+import org.eclipse.emf.cdo.server.IStoreManager;
+
+import org.eclipse.net4j.internal.util.lifecycle.Lifecycle;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class StoreManager extends Lifecycle implements IStoreManager
+{
+ private String storeType;
+
+ private String instanceID;
+
+ public StoreManager(String storeType)
+ {
+ this.storeType = storeType;
+ }
+
+ public String getStoreType()
+ {
+ return storeType;
+ }
+
+ public String getInstanceID()
+ {
+ return instanceID;
+ }
+
+ public void setInstanceID(String instanceID)
+ {
+ this.instanceID = instanceID;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java
new file mode 100644
index 0000000..0f7fc43
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreTransaction.java
@@ -0,0 +1,31 @@
+/***************************************************************************
+ * 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.cdo.internal.server;
+
+import org.eclipse.emf.cdo.server.IStoreTransaction;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class StoreTransaction implements IStoreTransaction
+{
+ private StoreManager store;
+
+ public StoreTransaction(StoreManager store)
+ {
+ this.store = store;
+ }
+
+ public StoreManager getStore()
+ {
+ return store;
+ }
+} \ No newline at end of file
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 0fed2de..e040f76 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
@@ -10,11 +10,11 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.server.RepositoryImpl;
-import org.eclipse.emf.cdo.internal.server.ResourceManagerImpl;
-import org.eclipse.emf.cdo.internal.server.RevisionManagerImpl;
-import org.eclipse.emf.cdo.internal.server.SessionImpl;
-import org.eclipse.emf.cdo.internal.server.SessionManagerImpl;
+import org.eclipse.emf.cdo.internal.server.Repository;
+import org.eclipse.emf.cdo.internal.server.ResourceManager;
+import org.eclipse.emf.cdo.internal.server.RevisionManager;
+import org.eclipse.emf.cdo.internal.server.Session;
+import org.eclipse.emf.cdo.internal.server.SessionManager;
import org.eclipse.net4j.signal.IndicationWithResponse;
@@ -36,27 +36,27 @@ public abstract class CDOServerIndication extends IndicationWithResponse
return signalID;
}
- protected SessionManagerImpl getSessionManager()
+ protected SessionManager getSessionManager()
{
return getSession().getSessionManager();
}
- protected RevisionManagerImpl getRevisionManager()
+ protected RevisionManager getRevisionManager()
{
return getRepository().getRevisionManager();
}
- protected ResourceManagerImpl getResourceManager()
+ protected ResourceManager getResourceManager()
{
return getRepository().getResourceManager();
}
- protected RepositoryImpl getRepository()
+ protected Repository getRepository()
{
return getSessionManager().getRepository();
}
- protected SessionImpl getSession()
+ protected Session getSession()
{
return getProtocol().getSession();
}
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 21e73b0..8c06590 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,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.server.SessionImpl;
+import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.signal.SignalProtocol;
@@ -21,7 +21,7 @@ import org.eclipse.net4j.signal.SignalReactor;
*/
public class CDOServerProtocol extends SignalProtocol
{
- private SessionImpl session;
+ private Session session;
public CDOServerProtocol()
{
@@ -32,12 +32,12 @@ public class CDOServerProtocol extends SignalProtocol
return CDOProtocolConstants.PROTOCOL_NAME;
}
- public SessionImpl getSession()
+ public Session getSession()
{
return session;
}
- public void setSession(SessionImpl session)
+ public void setSession(Session session)
{
this.session = session;
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
index cc00bed..7cbb82e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.bundle.CDOProtocol;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.server.RevisionManagerImpl;
+import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
@@ -125,7 +125,7 @@ public class CommitTransactionIndication extends CDOServerIndication
private void addRevisions(CDORevisionImpl[] revisions)
{
- RevisionManagerImpl revisionManager = getRevisionManager();
+ RevisionManager revisionManager = getRevisionManager();
for (CDORevisionImpl revision : revisions)
{
revision.setCreated(timeStamp);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
index 5f8447c..eef8864 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadObjectIndication.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.bundle.CDOProtocol;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.server.RevisionManagerImpl;
+import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
@@ -63,7 +63,7 @@ public class LoadObjectIndication extends CDOServerIndication
@Override
protected void responding(ExtendedDataOutputStream out) throws IOException
{
- RevisionManagerImpl rm = getRevisionManager();
+ RevisionManager rm = getRevisionManager();
CDORevisionImpl revision = timeStamp != null ? rm.getRevision(id, timeStamp) : rm.getRevision(id);
revision.write(out, null);
}
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 1565dd3..70e9c31 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
@@ -11,13 +11,13 @@
package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.bundle.CDOProtocol;
-import org.eclipse.emf.cdo.internal.server.RepositoryImpl;
-import org.eclipse.emf.cdo.internal.server.RepositoryManagerImpl;
-import org.eclipse.emf.cdo.internal.server.SessionImpl;
-import org.eclipse.emf.cdo.internal.server.SessionManagerImpl;
+import org.eclipse.emf.cdo.internal.server.Repository;
+import org.eclipse.emf.cdo.internal.server.RepositoryManager;
+import org.eclipse.emf.cdo.internal.server.Session;
+import org.eclipse.emf.cdo.internal.server.SessionManager;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.server.Repository;
-import org.eclipse.emf.cdo.server.Session;
+import org.eclipse.emf.cdo.server.IRepository;
+import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.net4j.signal.IndicationWithResponse;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -59,12 +59,12 @@ public class OpenSessionIndication extends IndicationWithResponse
@Override
protected void responding(ExtendedDataOutputStream out) throws IOException
{
- RepositoryImpl repository = RepositoryManagerImpl.INSTANCE.getRepository(repositoryName, true);
+ Repository repository = RepositoryManager.INSTANCE.getRepository(repositoryName, true);
if (repository == null)
{
if (PROTOCOL.isEnabled())
{
- PROTOCOL.format("Repository {0} not found", repositoryName);
+ PROTOCOL.format("IRepository {0} not found", repositoryName);
}
out.writeInt(CDOProtocolConstants.ERROR_REPOSITORY_NOT_FOUND);
@@ -72,8 +72,8 @@ public class OpenSessionIndication extends IndicationWithResponse
}
CDOServerProtocol serverProtocol = (CDOServerProtocol)getProtocol();
- SessionManagerImpl sessionManager = repository.getSessionManager();
- SessionImpl session = sessionManager.openSession(serverProtocol);
+ SessionManager sessionManager = repository.getSessionManager();
+ Session session = sessionManager.openSession(serverProtocol);
if (session == null)
{
if (PROTOCOL.isEnabled())
@@ -90,7 +90,7 @@ public class OpenSessionIndication extends IndicationWithResponse
writeRepositoryUUID(out, repository);
}
- private void writeSessionID(ExtendedDataOutputStream out, Session session) throws IOException
+ private void writeSessionID(ExtendedDataOutputStream out, ISession session) throws IOException
{
if (PROTOCOL.isEnabled())
{
@@ -100,7 +100,7 @@ public class OpenSessionIndication extends IndicationWithResponse
out.writeInt(session.getSessionID());
}
- private void writeRepositoryUUID(ExtendedDataOutputStream out, Repository repository) throws IOException
+ private void writeRepositoryUUID(ExtendedDataOutputStream out, IRepository repository) throws IOException
{
if (PROTOCOL.isEnabled())
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
index 4eb6f59..d3cebe4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
@@ -13,15 +13,17 @@ package org.eclipse.emf.cdo.server;
/**
* @author Eike Stepper
*/
-public interface Repository
+public interface IRepository
{
public String getName();
public String getUUID();
- public SessionManager getSessionManager();
+ public ISessionManager getSessionManager();
- public ResourceManager getResourceManager();
+ public IResourceManager getResourceManager();
- public RevisionManager getRevisionManager();
+ public IRevisionManager getRevisionManager();
+
+ public IStoreManager getStoreManager();
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java
new file mode 100644
index 0000000..43a8524
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepositoryManager.java
@@ -0,0 +1,23 @@
+/***************************************************************************
+ * 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.cdo.server;
+
+import org.eclipse.emf.cdo.internal.server.RepositoryManager;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IRepositoryManager
+{
+ public static final IRepositoryManager INSTANCE = RepositoryManager.INSTANCE;
+
+ public IRepository getRepository(String name, boolean createOnDemand);
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ResourceManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IResourceManager.java
index e0cef52..6efdd44 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ResourceManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IResourceManager.java
@@ -10,15 +10,15 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
-import org.eclipse.emf.cdo.internal.server.RepositoryImpl;
+import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.protocol.CDOID;
/**
* @author Eike Stepper
*/
-public interface ResourceManager
+public interface IResourceManager
{
- public RepositoryImpl getRepository();
+ public Repository getRepository();
public CDOID getResourceID(String path);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RevisionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRevisionManager.java
index acd54b2..538ab49 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRevisionManager.java
@@ -15,7 +15,7 @@ import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
/**
* @author Eike Stepper
*/
-public interface RevisionManager extends CDORevisionResolver
+public interface IRevisionManager extends CDORevisionResolver
{
- public Repository getRepository();
+ public IRepository getRepository();
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
index 0fee6b3..e5fcf21 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISession.java
@@ -15,9 +15,9 @@ import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
/**
* @author Eike Stepper
*/
-public interface Session
+public interface ISession
{
- public SessionManager getSessionManager();
+ public ISessionManager getSessionManager();
public CDOServerProtocol getProtocol();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java
index 7359db3..8d14c42 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISessionManager.java
@@ -15,11 +15,11 @@ import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
/**
* @author Eike Stepper
*/
-public interface SessionManager
+public interface ISessionManager
{
- public Repository getRepository();
+ public IRepository getRepository();
- public Session[] getSessions();
+ public ISession[] getSessions();
- public Session openSession(CDOServerProtocol protocol);
+ public ISession openSession(CDOServerProtocol protocol);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RepositoryManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreManager.java
index 5362b81..2032c41 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/RepositoryManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreManager.java
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (c) 2004-2007 Eike Stepper, Germany.
+ * 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
@@ -10,14 +10,19 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
-import org.eclipse.emf.cdo.internal.server.RepositoryManagerImpl;
-
/**
* @author Eike Stepper
*/
-public interface RepositoryManager
+public interface IStoreManager
{
- public static final RepositoryManager INSTANCE = RepositoryManagerImpl.INSTANCE;
+ public String getStoreType();
+
+ public String getInstanceID();
+
+ public IStoreTransaction startTransaction();
+
+ public void commitTransaction(IStoreTransaction transaction);
+
+ public void rollbackTransaction(IStoreTransaction transaction);
- public Repository getRepository(String name, boolean createOnDemand);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java
new file mode 100644
index 0000000..eb96bea
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreTransaction.java
@@ -0,0 +1,19 @@
+/***************************************************************************
+ * 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.cdo.server;
+
+/**
+ * @author Eike Stepper
+ */
+public interface IStoreTransaction
+{
+
+}