summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-23 11:36:01 (EDT)
committerEike Stepper2007-07-23 11:36:01 (EDT)
commit6db02f74d33f5ff475b2f6ba6872d3e435775ba2 (patch)
treea6f71aa2343cd8c511146ec6d13f924d487a8d62
parente2bb1b96cf03c08a186e2ae55258bfd5832615c2 (diff)
downloadcdo-6db02f74d33f5ff475b2f6ba6872d3e435775ba2.zip
cdo-6db02f74d33f5ff475b2f6ba6872d3e435775ba2.tar.gz
cdo-6db02f74d33f5ff475b2f6ba6872d3e435775ba2.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/OpenSessionIndication.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/CDO.docbin46592 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo/CDO.odsbin0 -> 12525 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java28
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java53
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java18
-rw-r--r--plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF1
11 files changed, 109 insertions, 34 deletions
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 1b3fbf8..48a69fc 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
@@ -60,14 +60,14 @@ public class CommitTransactionIndication extends CDOServerIndication
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
- try
- {
- Thread.sleep(100000000000L);
- }
- catch (InterruptedException ex)
- {
- throw new IOException(ex.getMessage());
- }
+ // try
+ // {
+ // Thread.sleep(100000000000L);
+ // }
+ // catch (InterruptedException ex)
+ // {
+ // throw new IOException(ex.getMessage());
+ // }
newPackages = readNewPackages(in);
newResources = readNewResources(in);
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 8cce108..1035a09 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,6 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
+import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.internal.server.RepositoryManager;
import org.eclipse.emf.cdo.internal.server.RepositoryPackageManager;
@@ -126,10 +127,13 @@ public class OpenSessionIndication extends IndicationWithResponse
{
if (PROTOCOL.isEnabled())
{
- PROTOCOL.format("Writing package URI: {0}", p.getPackageURI());
+ PROTOCOL.format("Writing package URI: {0}, dynamic={1}, metaIDRange={2}", p.getPackageURI(), p
+ .getMetaIDRange());
}
out.writeString(p.getPackageURI());
+ out.writeBoolean(p.isDynamic());
+ CDOIDRangeImpl.write(out, p.getMetaIDRange());
}
}
diff --git a/plugins/org.eclipse.emf.cdo/CDO.doc b/plugins/org.eclipse.emf.cdo/CDO.doc
deleted file mode 100644
index 7838837..0000000
--- a/plugins/org.eclipse.emf.cdo/CDO.doc
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo/CDO.ods b/plugins/org.eclipse.emf.cdo/CDO.ods
new file mode 100644
index 0000000..f492092
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/CDO.ods
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 73f69eb..5ef0e04 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -244,7 +244,7 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
Object targetValue = getTargetValue(target, feature, view);
if (feature.isMany())
{
- List revisionList = revision.getList(feature);
+ List revisionList = revision.getList(feature); // TODO lazy?
revisionList.clear();
if (targetValue != null)
@@ -268,7 +268,7 @@ public class CDOAdapterImpl extends AdapterImpl implements InternalCDOObject
}
else
{
- throw new ClassCastException(targetValue.getClass().getName());
+ throw new ImplementationError("Not an InternalEList: " + targetValue.getClass().getName());
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index c500ce1..6b78a38 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -341,7 +341,7 @@ public class CDOSessionImpl extends Lifecycle implements CDOSession
OpenSessionResult result = request.send();
sessionID = result.getSessionID();
repositoryUUID = result.getRepositoryUUID();
- packageManager.addPackageProxies(result.getPackageURIs());
+ packageManager.addPackageProxies(result.getPackageInfos());
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
index d42a40c..8817e81 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
@@ -12,11 +12,14 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
+import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.EMFUtil;
import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.protocol.LoadPackageRequest;
+import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult.PackageInfo;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import java.util.Collection;
@@ -39,11 +42,15 @@ public class CDOSessionPackageManager extends CDOPackageManagerImpl
return session;
}
- public void addPackageProxies(Collection<String> packageURIs)
+ public void addPackageProxies(Collection<PackageInfo> packageInfos)
{
- for (String packageURI : packageURIs)
+ for (PackageInfo info : packageInfos)
{
- CDOPackageImpl proxy = new CDOPackageImpl(this, packageURI);
+ String packageURI = info.getPackageURI();
+ boolean dynamic = info.isDynamic();
+ CDOIDRange metaIDRange = info.getMetaIDRange();
+
+ CDOPackageImpl proxy = new CDOPackageImpl(this, packageURI, dynamic, metaIDRange);
addPackage(proxy);
session.getPackageRegistry().putPackageDescriptor(proxy);
}
@@ -52,9 +59,24 @@ public class CDOSessionPackageManager extends CDOPackageManagerImpl
@Override
protected void resolve(CDOPackageImpl cdoPackage)
{
+ if (!cdoPackage.isDynamic())
+ {
+ String uri = cdoPackage.getPackageURI();
+ EPackage ePackage = session.getPackageRegistry().getEPackage(uri);
+ if (ePackage != null)
+ {
+ ModelUtil.initializeCDOPackage(ePackage, cdoPackage);
+ return;
+ }
+ }
+
try
{
new LoadPackageRequest(session.getChannel(), cdoPackage).send();
+ if (!cdoPackage.isDynamic())
+ {
+ OM.LOG.info("Dynamic package created for " + cdoPackage.getPackageURI());
+ }
}
catch (RuntimeException ex)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java
index 162618c..5422cae 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionRequest.java
@@ -10,6 +10,8 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
+import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
+import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.util.ServerException;
@@ -23,8 +25,6 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.HashSet;
-import java.util.Set;
/**
* @author Eike Stepper
@@ -85,7 +85,8 @@ public class OpenSessionRequest extends RequestWithConfirmation<OpenSessionResul
PROTOCOL.format("Read repositoryUUID: {0}", repositoryUUID);
}
- Set<String> packageURIs = new HashSet();
+ OpenSessionResult result = new OpenSessionResult(sessionID, repositoryUUID);
+
for (;;)
{
String packageURI = in.readString();
@@ -94,14 +95,16 @@ public class OpenSessionRequest extends RequestWithConfirmation<OpenSessionResul
break;
}
+ boolean dynamic = in.readBoolean();
+ CDOIDRange metaIDRange = CDOIDRangeImpl.read(in);
if (PROTOCOL.isEnabled())
{
- PROTOCOL.format("Read package URI: {0}", packageURI);
+ PROTOCOL.format("Read package URI: {0}, dynamic={1}, metaIDRange={2}", packageURI, dynamic, metaIDRange);
}
- packageURIs.add(packageURI);
+ result.addPackageInfo(packageURI, dynamic, metaIDRange);
}
- return new OpenSessionResult(sessionID, repositoryUUID, packageURIs);
+ return result;
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
index cfd7c7d..c00cd78 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
@@ -10,7 +10,10 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import java.util.Set;
+import org.eclipse.emf.cdo.protocol.CDOIDRange;
+
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Eike Stepper
@@ -21,13 +24,12 @@ public final class OpenSessionResult
private String repositoryUUID;
- private Set<String> packageURIs;
+ private List<PackageInfo> packageInfos = new ArrayList();
- public OpenSessionResult(int sessionID, String repositoryUUID, Set<String> packageURIs)
+ public OpenSessionResult(int sessionID, String repositoryUUID)
{
this.sessionID = sessionID;
this.repositoryUUID = repositoryUUID;
- this.packageURIs = packageURIs;
}
public int getSessionID()
@@ -40,8 +42,47 @@ public final class OpenSessionResult
return repositoryUUID;
}
- public Set<String> getPackageURIs()
+ public List<PackageInfo> getPackageInfos()
+ {
+ return packageInfos;
+ }
+
+ void addPackageInfo(String packageURI, boolean dynamic, CDOIDRange metaIDRange)
+ {
+ packageInfos.add(new PackageInfo(packageURI, dynamic, metaIDRange));
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static final class PackageInfo
{
- return packageURIs;
+ private String packageURI;
+
+ private boolean dynamic;
+
+ private CDOIDRange metaIDRange;
+
+ public PackageInfo(String packageURI, boolean dynamic, CDOIDRange metaIDRange)
+ {
+ this.packageURI = packageURI;
+ this.dynamic = dynamic;
+ this.metaIDRange = metaIDRange;
+ }
+
+ public String getPackageURI()
+ {
+ return packageURI;
+ }
+
+ public boolean isDynamic()
+ {
+ return dynamic;
+ }
+
+ public CDOIDRange getMetaIDRange()
+ {
+ return metaIDRange;
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index dd4595b..942d2b6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -34,7 +34,6 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.internal.cdo.CDOFactoryImpl;
import org.eclipse.emf.internal.cdo.CDOPackageRegistryImpl;
-import org.eclipse.emf.internal.cdo.CDOSessionImpl;
import org.eclipse.emf.internal.cdo.CDOSessionPackageManager;
/**
@@ -90,6 +89,16 @@ public final class ModelUtil
return CDOTypeImpl.STRING;
}
+ public static void initializeCDOPackage(EPackage ePackage, CDOPackageImpl cdoPackage)
+ {
+ cdoPackage.setClientInfo(ePackage);
+ for (EClass eClass : EMFUtil.getPersistentClasses(ePackage))
+ {
+ CDOClassImpl cdoClass = createCDOClass(eClass, cdoPackage);
+ cdoPackage.addClass(cdoClass);
+ }
+ }
+
public static CDOPackageImpl getCDOPackage(EPackage ePackage, CDOSessionPackageManager packageManager)
{
String packageURI = ePackage.getNsURI();
@@ -124,12 +133,7 @@ public final class ModelUtil
CDOIDRange idRange = packageManager.getSession().registerEPackage(ePackage);
CDOPackageImpl cdoPackage = new CDOPackageImpl(packageManager, packageURI, name, ecore, dynamic, idRange);
- cdoPackage.setClientInfo(ePackage);
- for (EClass eClass : EMFUtil.getPersistentClasses(ePackage))
- {
- CDOClassImpl cdoClass = createCDOClass(eClass, cdoPackage);
- cdoPackage.addClass(cdoClass);
- }
+ initializeCDOPackage(ePackage, cdoPackage);
return cdoPackage;
}
diff --git a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
index 2a5be85..bb259fe 100644
--- a/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.tcp/META-INF/MANIFEST.MF
@@ -10,5 +10,6 @@ Require-Bundle: org.eclipse.core.runtime;resolution:=optional,
org.eclipse.net4j;visibility:=reexport
Import-Package: org.osgi.framework;version="1.3.0";resolution:=optional
Export-Package: org.eclipse.net4j.internal.tcp;version="0.8.0",
+ org.eclipse.net4j.internal.tcp.bundle;version="0.8.0";x-friends:="org.eclipse.emf.cdo.tests.tdd",
org.eclipse.net4j.tcp;version="0.8.0"
Eclipse-LazyStart: true