Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-11-05 03:52:35 -0500
committerEike Stepper2018-11-05 03:52:35 -0500
commit6054292cf737bf6033e02884a1d01c366e938f25 (patch)
tree589aca50267d4ed9383f27e1ab7f222a2e91e991
parenta55728e2bb422f4bf3b66f05e5c48ec78dc5278e (diff)
downloadcdo-6054292cf737bf6033e02884a1d01c366e938f25.tar.gz
cdo-6054292cf737bf6033e02884a1d01c366e938f25.tar.xz
cdo-6054292cf737bf6033e02884a1d01c366e938f25.zip
[540776] Add a InternalCDOObject.cdoInternalPreAttach() callback
https://bugs.eclipse.org/bugs/show_bug.cgi?id=540776
-rw-r--r--plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF52
-rw-r--r--plugins/org.eclipse.emf.cdo/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOObject.java5
6 files changed, 55 insertions, 27 deletions
diff --git a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
index afff752c79..601c9c9534 100644
--- a/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo; singleton:=true
-Bundle-Version: 4.6.200.qualifier
+Bundle-Version: 4.7.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -10,28 +10,28 @@ Bundle-Activator: org.eclipse.emf.internal.cdo.bundle.Activator$Implementation
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)";resolution:=optional,
org.eclipse.emf.cdo.common;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo;version="4.6.200",
- org.eclipse.emf.cdo.eresource;version="4.6.200",
- org.eclipse.emf.cdo.eresource.impl;version="4.6.200",
- org.eclipse.emf.cdo.eresource.util;version="4.6.200",
- org.eclipse.emf.cdo.eresource.validation;version="4.6.200",
- org.eclipse.emf.cdo.etypes;version="4.6.200",
- org.eclipse.emf.cdo.etypes.impl;version="4.6.200",
- org.eclipse.emf.cdo.etypes.util;version="4.6.200",
- org.eclipse.emf.cdo.session;version="4.6.200",
- org.eclipse.emf.cdo.session.remote;version="4.6.200",
- org.eclipse.emf.cdo.transaction;version="4.6.200",
- org.eclipse.emf.cdo.util;version="4.6.200",
- org.eclipse.emf.cdo.view;version="4.6.200",
- org.eclipse.emf.internal.cdo;version="4.6.200",
- org.eclipse.emf.internal.cdo.analyzer;version="4.6.200";
+Export-Package: org.eclipse.emf.cdo;version="4.7.0",
+ org.eclipse.emf.cdo.eresource;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.impl;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.util;version="4.7.0",
+ org.eclipse.emf.cdo.eresource.validation;version="4.7.0",
+ org.eclipse.emf.cdo.etypes;version="4.7.0",
+ org.eclipse.emf.cdo.etypes.impl;version="4.7.0",
+ org.eclipse.emf.cdo.etypes.util;version="4.7.0",
+ org.eclipse.emf.cdo.session;version="4.7.0",
+ org.eclipse.emf.cdo.session.remote;version="4.7.0",
+ org.eclipse.emf.cdo.transaction;version="4.7.0",
+ org.eclipse.emf.cdo.util;version="4.7.0",
+ org.eclipse.emf.cdo.view;version="4.7.0",
+ org.eclipse.emf.internal.cdo;version="4.7.0",
+ org.eclipse.emf.internal.cdo.analyzer;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.bundle;version="4.6.200";x-friends:="org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.messages;version="4.6.200";x-internal:=true,
- org.eclipse.emf.internal.cdo.object;version="4.6.200";
+ org.eclipse.emf.internal.cdo.bundle;version="4.7.0";x-friends:="org.eclipse.emf.cdo.ui",
+ org.eclipse.emf.internal.cdo.messages;version="4.7.0";x-internal:=true,
+ org.eclipse.emf.internal.cdo.object;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -40,13 +40,13 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui,
org.eclipse.emf.cdo.edit",
- org.eclipse.emf.internal.cdo.query;version="4.6.200";
+ org.eclipse.emf.internal.cdo.query;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests.objectivity",
- org.eclipse.emf.internal.cdo.session;version="4.6.200";
+ org.eclipse.emf.internal.cdo.session;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -56,23 +56,23 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.security.ui,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.session.remote;version="4.6.200";
+ org.eclipse.emf.internal.cdo.session.remote;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.transaction;version="4.6.200";
+ org.eclipse.emf.internal.cdo.transaction;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.internal.cdo.util;version="4.6.200";
+ org.eclipse.emf.internal.cdo.util;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.ui",
- org.eclipse.emf.internal.cdo.view;version="4.6.200";
+ org.eclipse.emf.internal.cdo.view;version="4.7.0";
x-friends:="org.eclipse.emf.cdo.net4j,
org.eclipse.emf.cdo.server,
org.eclipse.emf.cdo.tests,
@@ -80,6 +80,6 @@ Export-Package: org.eclipse.emf.cdo;version="4.6.200",
org.eclipse.emf.cdo.ui.ide,
org.eclipse.emf.cdo.explorer,
org.eclipse.emf.cdo.explorer.ui",
- org.eclipse.emf.spi.cdo;version="4.6.200"
+ org.eclipse.emf.spi.cdo;version="4.7.0"
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.emf.cdo
diff --git a/plugins/org.eclipse.emf.cdo/pom.xml b/plugins/org.eclipse.emf.cdo/pom.xml
index e6f81381bb..f883a640b7 100644
--- a/plugins/org.eclipse.emf.cdo/pom.xml
+++ b/plugins/org.eclipse.emf.cdo/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo</artifactId>
- <version>4.6.200-SNAPSHOT</version>
+ <version>4.7.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index b4212e50e4..760ebd7239 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -38,6 +38,7 @@ import org.eclipse.emf.internal.cdo.view.CDOStateMachine;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
+import org.eclipse.net4j.util.om.OMPlatform;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.common.notify.Adapter;
@@ -102,6 +103,8 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
private static final EObservableAdapterList.Listener[] ADAPTERS_LISTENERS = { ADAPTERS_LISTENER };
+ private static final boolean EMF_TO_STRING = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.internal.cdo.CDOObjectImpl.emfToString");
+
/**
* Optimized storage of {@link CDOObject#cdoView()} and {@link CDOObject#cdoState()}.
*
@@ -431,6 +434,14 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
cdoInternalSetRevision(null);
}
+ /**
+ * @since 4.7
+ */
+ public void cdoInternalPreAttach()
+ {
+ // Do nothing
+ }
+
public final void cdoInternalPostAttach()
{
if (TRACER.isEnabled())
@@ -1210,6 +1221,11 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
@Override
public String toString()
{
+ if (EMF_TO_STRING)
+ {
+ return super.toString();
+ }
+
String str = eClass().getName();
CDOID id = cdoID();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
index eef7dc1202..d57789370e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
@@ -257,6 +257,11 @@ public abstract class CDOLegacyWrapper extends CDOObjectWrapper
}
}
+ public void cdoInternalPreAttach()
+ {
+ // Do nothing
+ }
+
public void cdoInternalPostAttach()
{
instanceToRevision();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
index 8fd86f8d54..bf34423f1f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
@@ -217,6 +217,8 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
try
{
+ object.cdoInternalPreAttach();
+
List<InternalCDOObject> contents = new ArrayList<InternalCDOObject>();
prepare(object, Pair.create(transaction, contents));
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOObject.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOObject.java
index a5fd4edd65..2a8ed2a298 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOObject.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOObject.java
@@ -47,6 +47,11 @@ public interface InternalCDOObject extends CDOObject, InternalEObject, InternalC
*/
public InternalCDORevision cdoRevision(boolean loadOnDemand);
+ /**
+ * @since 4.7
+ */
+ public void cdoInternalPreAttach();
+
public void cdoInternalPostAttach();
public void cdoInternalPostDetach(boolean remote);

Back to the top