Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-14 13:16:00 -0400
committerEike Stepper2008-10-14 13:16:00 -0400
commit43ac671ddafb2d0e3d10d3998ff34a3d4d20ec3e (patch)
tree90213a71ca17edc78c80f3fe8c8ac89337ca4267
parent820c3be825df47d47510d64230cca983d6b876fc (diff)
downloadcdo-43ac671ddafb2d0e3d10d3998ff34a3d4d20ec3e.tar.gz
cdo-43ac671ddafb2d0e3d10d3998ff34a3d4d20ec3e.tar.xz
cdo-43ac671ddafb2d0e3d10d3998ff34a3d4d20ec3e.zip
[250809] Enhance the way stores express their capabilities
https://bugs.eclipse.org/bugs/show_bug.cgi?id=250809
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/CommitManager.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java35
5 files changed, 46 insertions, 34 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 850b48c5ae..4b8de1786c 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
@@ -30,6 +30,7 @@ import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.spi.db.DBSchema;
import org.eclipse.net4j.util.ImplementationError;
+import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import javax.sql.DataSource;
@@ -55,15 +56,20 @@ public class DBStore extends LongIDStore implements IDBStore
private IDBConnectionProvider dbConnectionProvider;
- private int nextPackageID;
+ @ExcludeFromDump
+ private transient StoreAccessorPool readerPool = new StoreAccessorPool(this, null);
- private int nextClassID;
+ @ExcludeFromDump
+ private transient StoreAccessorPool writerPool = new StoreAccessorPool(this, null);
- private int nextFeatureID;
+ @ExcludeFromDump
+ private transient int nextPackageID;
- private StoreAccessorPool readerPool = new StoreAccessorPool(this, null);
+ @ExcludeFromDump
+ private transient int nextClassID;
- private StoreAccessorPool writerPool = new StoreAccessorPool(this, null);
+ @ExcludeFromDump
+ private transient int nextFeatureID;
public DBStore()
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/CommitManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/CommitManager.java
index 205af5c86a..0c06e1deb9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/CommitManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/CommitManager.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.internal.server.Transaction.InternalCommitContext;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IRepositoryElement;
+import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
import java.util.Map;
@@ -32,9 +33,11 @@ public class CommitManager extends Lifecycle implements IRepositoryElement
{
private IRepository repository;
- private ExecutorService executors;
+ @ExcludeFromDump
+ private transient ExecutorService executors;
- private Map<Transaction, TransactionCommitContextEntry> commitContextMap = new ConcurrentHashMap<Transaction, TransactionCommitContextEntry>();
+ @ExcludeFromDump
+ private transient Map<Transaction, TransactionCommitContextEntry> commitContextMap = new ConcurrentHashMap<Transaction, TransactionCommitContextEntry>();
public CommitManager()
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
index 71aeb5d033..3331898bd1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
@@ -17,6 +17,8 @@ import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.spi.common.CDOIDLongFactoryImpl;
+import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
+
import java.util.Set;
/**
@@ -28,6 +30,7 @@ public abstract class LongIDStore extends Store
private static final CDOIDLongFactoryImpl CDOID_OBJECT_FACTORY = new CDOIDLongFactoryImpl();
+ @ExcludeFromDump
private transient long lastObjectID;
/**
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
index e3a70b746f..a2e49b8e1d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.net4j.util.StringUtil;
+import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -35,13 +36,17 @@ import java.util.Set;
*/
public abstract class Store extends Lifecycle implements IStore
{
- private final String type;
+ @ExcludeFromDump
+ private final transient String type;
- private final Set<ChangeFormat> supportedChangeFormats;
+ @ExcludeFromDump
+ private final transient Set<ChangeFormat> supportedChangeFormats;
- private final Set<RevisionTemporality> supportedRevisionTemporalities;
+ @ExcludeFromDump
+ private final transient Set<RevisionTemporality> supportedRevisionTemporalities;
- private final Set<RevisionParallelism> supportedRevisionParallelisms;
+ @ExcludeFromDump
+ private final transient Set<RevisionParallelism> supportedRevisionParallelisms;
private RevisionTemporality revisionTemporality = RevisionTemporality.NONE;
@@ -49,9 +54,11 @@ public abstract class Store extends Lifecycle implements IStore
private IRepository repository;
- private long lastMetaID;
+ @ExcludeFromDump
+ private transient long lastMetaID;
- private CDOPathFeature resourcePathFeature;
+ @ExcludeFromDump
+ private transient CDOPathFeature resourcePathFeature;
/**
* @since 2.0
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
index 6a765785f4..fa022f83bb 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
@@ -348,15 +348,11 @@ public class ContainmentTest extends AbstractCDOTest
{
byte[] data = null;
{
+ CDOSession session = openModel1Session();
ResourceSet resourceSet = new ResourceSetImpl();
-
- CDOSession session = openSession();
-
- CDOTransaction transaction = session.openTransaction(resourceSet);
-
resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put("test", new XMIResourceFactoryImpl());
- session.getPackageRegistry().putEPackage(getModel1Package());
+ CDOTransaction transaction = session.openTransaction(resourceSet);
Resource resource1 = resourceSet.createResource(URI.createURI("test://1"));
Resource resource2 = transaction.createResource("test");
@@ -381,26 +377,23 @@ public class ContainmentTest extends AbstractCDOTest
data = outputStream.toByteArray();
transaction.commit();
}
- removeAllRevisions(getRepository().getRevisionManager());
- {
- EPackage packageObject = createDynamicEPackage();
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getPackageRegistry().put(packageObject.getNsURI(), packageObject);
- CDOSession session = openSession();
- CDOTransaction transaction = session.openTransaction(resourceSet);
-
- resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put("test", new XMIResourceFactoryImpl());
+ removeAllRevisions(getRepository().getRevisionManager());
+ EPackage packageObject = createDynamicEPackage();
- Resource resource1 = resourceSet.createResource(URI.createURI("test://1"));
- resource1.load(new ByteArrayInputStream(data), null);
- Resource resource = transaction.getResource("test");
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getPackageRegistry().put(packageObject.getNsURI(), packageObject);
+ resourceSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put("test", new XMIResourceFactoryImpl());
- Order order = (Order)resource.getContents().get(0);
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction(resourceSet);
- assertEquals(resource1.getContents().get(0), order.eContainer());
- }
+ Resource resource1 = resourceSet.createResource(URI.createURI("test://1"));
+ resource1.load(new ByteArrayInputStream(data), null);
+ Resource resource = transaction.getResource("test");
+ Order order = (Order)resource.getContents().get(0);
+ assertEquals(resource1.getContents().get(0), order.eContainer());
}
public void testObjectNotSameResourceThanItsContainer_WithoutCDO() throws Exception

Back to the top