summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-17 12:46:13 (EDT)
committerEike Stepper2007-08-17 12:46:13 (EDT)
commit5d9ae47b55fa4d30eb01b46bfd30aeec260fafcb (patch)
tree379239d5a635653622d592d943a8ae6527163125
parentc35520e2ef57ba12e34fe376476c573faf32167c (diff)
downloadcdo-5d9ae47b55fa4d30eb01b46bfd30aeec260fafcb.zip
cdo-5d9ae47b55fa4d30eb01b46bfd30aeec260fafcb.tar.gz
cdo-5d9ae47b55fa4d30eb01b46bfd30aeec260fafcb.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java31
4 files changed, 34 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index ff88579..9c97ca5 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.internal.server.Store;
+import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreReader;
import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IView;
@@ -77,7 +78,7 @@ public class DBStore extends Store implements IDBStore
return dataSource;
}
- public IStoreReader getReader() throws DBException
+ public IStoreReader getReader(ISession session) throws DBException
{
return new DBStoreReader(this);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
index 678d0c2..e9a3790 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
@@ -70,7 +70,7 @@ public class PackageManager extends CDOPackageManagerImpl implements IPackageMan
protected void doActivate() throws Exception
{
super.doActivate();
- IStoreReader storeReader = repository.getStore().getReader();
+ IStoreReader storeReader = repository.getStore().getReader(null);
Collection<CDOPackageInfo> packageInfos = storeReader.readPackageInfos();
for (CDOPackageInfo info : packageInfos)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
index 30ad98f..fc4bd82 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CDOReadIndication.java
@@ -31,7 +31,7 @@ public abstract class CDOReadIndication extends CDOServerIndication
protected void execute(BufferInputStream in, BufferOutputStream out) throws Exception
{
IStore store = getStore();
- IStoreReader storeReader = store.getReader();
+ IStoreReader storeReader = store.getReader(getSession());
try
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
index f99159d..a62ee4b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
@@ -10,6 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
+import org.eclipse.net4j.internal.util.lifecycle.LifecycleEventAdapter;
+
/**
* @author Eike Stepper
*/
@@ -19,7 +21,34 @@ public interface IStore extends IRepositoryElement
public void setRepository(IRepository repository);
- public IStoreReader getReader();
+ /**
+ * Returns a reader that can be used to read from this store in the context of
+ * the given session.
+ *
+ * @param session
+ * The session that should be used as a context for read access or
+ * <code>null</code>. The store implementor is free to interpret
+ * and use the session in a manner suitable for him or ignore it at
+ * all. It is meant only as a hint. Implementor can use it as a key
+ * into a cache and/or register a {@link LifecycleEventAdapter} with
+ * it to intercept cleanup on session close. Note however that the
+ * session can be <code>null</code>, for example during startup of
+ * the server while the repositories are initialized but before any
+ * user session has been opened.
+ */
+ public IStoreReader getReader(ISession session);
+ /**
+ * Returns a writer that can be used to write to this store in the context of
+ * the given view. The given view is always marked as a transaction.
+ *
+ * @param session
+ * The view that must be used as a context for write access. The
+ * store implementor is free to interpret and use the view in a
+ * manner suitable for him or ignore it at all. It is meant only as a
+ * hint. Implementor can use it as a key into a cache and/or register
+ * a {@link LifecycleEventAdapter} with it to intercept cleanup on
+ * view close.
+ */
public IStoreWriter getWriter(IView view);
}