summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-28 13:16:45 (EDT)
committerEike Stepper2007-08-28 13:16:45 (EDT)
commit0d219aad5599974ecc1238850bb53f0b1d1b15ee (patch)
treeec62e6916e93af35c26e2ebda10417915e2c5de0
parentedd64c7dd21a70ab84ec940614e71579287994f3 (diff)
downloadcdo-0d219aad5599974ecc1238850bb53f0b1d1b15ee.zip
cdo-0d219aad5599974ecc1238850bb53f0b1d1b15ee.tar.gz
cdo-0d219aad5599974ecc1238850bb53f0b1d1b15ee.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/plugin.properties19
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ServerInfo.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java7
5 files changed, 44 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/plugin.properties b/plugins/org.eclipse.emf.cdo.server.db/plugin.properties
new file mode 100644
index 0000000..6576c1a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.db/plugin.properties
@@ -0,0 +1,19 @@
+# <copyright>
+# </copyright>
+#
+# $Id$
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = CDO Server DB Support
+providerName = Eclipse.org
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
index e544c5a..593049c 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/Mapping.java
@@ -14,12 +14,14 @@ import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOType;
+import org.eclipse.emf.cdo.server.db.IDBStore;
import org.eclipse.emf.cdo.server.db.IDBStoreAccessor;
import org.eclipse.emf.cdo.server.db.IMapping;
import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
+import org.eclipse.net4j.db.IDBAdapter;
import org.eclipse.net4j.db.IDBField;
import org.eclipse.net4j.db.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -145,12 +147,12 @@ public abstract class Mapping implements IMapping
protected String mangleTableName(String name, int attempt)
{
- return mappingStrategy.getStore().getDBAdapter().mangleTableName(name, attempt);
+ return getDBAdapter().mangleTableName(name, attempt);
}
protected String mangleFieldName(String name, int attempt)
{
- return mappingStrategy.getStore().getDBAdapter().mangleFieldName(name, attempt);
+ return getDBAdapter().mangleFieldName(name, attempt);
}
protected IDBTable addTable(String name)
@@ -247,4 +249,10 @@ public abstract class Mapping implements IMapping
throw new ImplementationError("Unrecognized CDOType: " + type);
}
+
+ protected IDBAdapter getDBAdapter()
+ {
+ IDBStore store = mappingStrategy.getStore();
+ return store.getDBAdapter();
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ServerInfo.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ServerInfo.java
index eeba09d..75702f9 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ServerInfo.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ServerInfo.java
@@ -24,6 +24,12 @@ public abstract class ServerInfo
this.dbID = dbID;
}
+ @Override
+ public String toString()
+ {
+ return String.valueOf(dbID);
+ }
+
public static int getDBID(CDOModelElement modelElement)
{
return ((ServerInfo)modelElement.getServerInfo()).dbID;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
index 47ed4bf..ea02d46 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/bundle/OM.java
@@ -11,10 +11,10 @@
package org.eclipse.emf.cdo.internal.server.bundle;
import org.eclipse.emf.cdo.internal.server.RepositoryConfigurator;
+import org.eclipse.emf.cdo.server.CDOServerUtil;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.net4j.util.container.IPluginContainer;
-import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMBundle;
import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.OSGiActivator;
@@ -62,9 +62,7 @@ public abstract class OM
DEBUG.trace(OM.class, "Activating repository " + repository.getName());
}
- LifecycleUtil.activate(repository);
- IPluginContainer.INSTANCE.putElement("org.eclipse.emf.cdo.server.repositories", "default", repository.getName(),
- repository);
+ CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
index 15047b7..1fe2837 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerUtil.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocolFactory;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.container.IManagedContainer;
+import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.OMPlatform;
import org.w3c.dom.Document;
@@ -45,6 +46,12 @@ public final class CDOServerUtil
container.registerFactory(new CDOServerProtocolFactory(repositoryProvider));
}
+ public static void addRepository(IManagedContainer container, IRepository repository)
+ {
+ LifecycleUtil.activate(repository);
+ container.putElement(RepositoryFactory.PRODUCT_GROUP, RepositoryFactory.TYPE, repository.getName(), repository);
+ }
+
public static Element getRepositoryConfig(String repositoryName) throws ParserConfigurationException, SAXException,
IOException
{