Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/.settings/.api_filters6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionConfiguration.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java43
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOFetchRuleManager.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java23
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java52
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java2
14 files changed, 188 insertions, 36 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
index f8ebfb18a5..da5cf9f376 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
@@ -212,11 +212,13 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
throw new UnsupportedOperationException();
}
+ @SuppressWarnings("deprecation")
public CDOFeatureAnalyzer getFeatureAnalyzer()
{
return CDOFeatureAnalyzer.NOOP;
}
+ @SuppressWarnings("deprecation")
public void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer)
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
index 9a9b5fce34..522accd79f 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.util.CDOFetchRule;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.config.impl.SessionConfig;
import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
import org.eclipse.emf.cdo.tests.model1.SalesOrder;
@@ -23,11 +24,8 @@ import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.analyzer.CDOFeatureAnalyzerModelBased;
-import org.eclipse.emf.internal.cdo.analyzer.CDOFetchRuleManagerThreadLocal;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.spi.cdo.InternalCDOSession;
-import org.eclipse.emf.spi.cdo.InternalCDOTransaction;
import java.util.ArrayList;
import java.util.List;
@@ -86,17 +84,15 @@ public class FetchRuleAnalyzerTest extends AbstractCDOTest
}
msg("Opening session");
- InternalCDOSession session = (InternalCDOSession)openSession();
- session.setFetchRuleManager(new CDOFetchRuleManagerThreadLocal());
+ getTestProperties().put(SessionConfig.PROP_TEST_FETCH_RULE_MANAGER, CDOUtil.createThreadLocalFetchRuleManager());
+ CDOSession session = openSession();
msg("Opening transaction");
- InternalCDOTransaction transaction = (InternalCDOTransaction)session.openTransaction();
- CDOFeatureAnalyzerModelBased featureanalyzerModelBased = new CDOFeatureAnalyzerModelBased();
- transaction.setFeatureAnalyzer(featureanalyzerModelBased);
+ CDOTransaction transaction = session.openTransaction();
+ transaction.options().setFeatureAnalyzer(CDOUtil.createModelBasedFeatureAnalyzer());
transaction.options().setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10));
msg("Getting resource");
-
for (CDOObject companyObject : listOfCompany)
{
Company company = (Company)transaction.getObject(companyObject.cdoID(), true);
@@ -107,9 +103,9 @@ public class FetchRuleAnalyzerTest extends AbstractCDOTest
}
// Number of fetch should be 20.
- assertEquals(20, featureanalyzerModelBased.getFetchCount());
+ assertEquals(20, new CDOFeatureAnalyzerModelBased().getFetchCount());
- List<CDOFetchRule> fetchRules = featureanalyzerModelBased.getFetchRules(null);
+ List<CDOFetchRule> fetchRules = new CDOFeatureAnalyzerModelBased().getFetchRules(null);
assertEquals(2, fetchRules.size());
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
index dd28b225a5..aece256fd4 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/SessionConfig.java
@@ -23,6 +23,7 @@ import org.eclipse.emf.cdo.tests.config.IRepositoryConfig;
import org.eclipse.emf.cdo.tests.config.ISessionConfig;
import org.eclipse.emf.cdo.tests.util.TestRevisionManager;
import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
import org.eclipse.emf.cdo.view.CDOViewProvider;
import org.eclipse.emf.cdo.view.CDOViewProviderRegistry;
@@ -56,6 +57,8 @@ public abstract class SessionConfig extends Config implements ISessionConfig
public static final String PROP_TEST_CREDENTIALS_PROVIDER = "test.session.CredentialsProvider";
+ public static final String PROP_TEST_FETCH_RULE_MANAGER = "test.session.FetchRuleManager";
+
private static final long serialVersionUID = 1L;
private transient Set<CDOSession> sessions;
@@ -170,6 +173,11 @@ public abstract class SessionConfig extends Config implements ISessionConfig
return (IPasswordCredentialsProvider)getTestProperty(PROP_TEST_CREDENTIALS_PROVIDER);
}
+ protected CDOFetchRuleManager getTestFetchRuleManager()
+ {
+ return (CDOFetchRuleManager)getTestProperty(PROP_TEST_FETCH_RULE_MANAGER);
+ }
+
protected abstract CDOSessionConfiguration createSessionConfiguration(String repositoryName);
protected void configureSession(CDOSession session)
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
index f39bca81f1..68adb410ef 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/util/TestSessionConfiguration.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.cdo.common.id.CDOIDGenerator;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticator;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.CDOSessionConfiguration;
+import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
import org.eclipse.net4j.util.event.Notifier;
@@ -93,4 +94,14 @@ public abstract class TestSessionConfiguration extends Notifier implements CDOSe
{
throw new UnsupportedOperationException();
}
+
+ public CDOFetchRuleManager getFetchRuleManager()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setFetchRuleManager(CDOFetchRuleManager fetchRuleManager)
+ {
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo/.settings/.api_filters b/plugins/org.eclipse.emf.cdo/.settings/.api_filters
index db1dc5a552..2668125970 100644
--- a/plugins/org.eclipse.emf.cdo/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo/.settings/.api_filters
@@ -37,12 +37,6 @@
<message_argument value="CDOSession"/>
</message_arguments>
</filter>
- <filter id="574619656">
- <message_arguments>
- <message_argument value="CDOCommonSession"/>
- <message_argument value="CDOSession"/>
- </message_arguments>
- </filter>
</resource>
<resource path="src/org/eclipse/emf/cdo/session/CDOSession.java" type="org.eclipse.emf.cdo.session.CDOSession$Options">
<filter id="571473929">
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionConfiguration.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionConfiguration.java
index b6549c70b0..b9a0b15a38 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionConfiguration.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionConfiguration.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
import org.eclipse.emf.cdo.common.id.CDOIDGenerator;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticator;
+import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.INotifier;
@@ -98,6 +99,21 @@ public interface CDOSessionConfiguration extends INotifier
public void setIDGenerator(CDOIDGenerator idGenerator);
/**
+ * @see CDOSession#getFetchRuleManager()
+ * @since 4.1
+ */
+ public CDOFetchRuleManager getFetchRuleManager();
+
+ /**
+ * A special ID generator can be set <b>before</b> the session is opened and can not be changed thereafter. If not
+ * <code>null</code>, the passed generator <b>must be</b> thread-safe.
+ *
+ * @see CDOSession#getFetchRuleManager()
+ * @since 4.1
+ */
+ public void setFetchRuleManager(CDOFetchRuleManager fetchRuleManager);
+
+ /**
* Returns the authenticator of this configuration, never <code>null</code>.
*/
public CDOAuthenticator getAuthenticator();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index 495ed65fb9..6bbb62dfbd 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -23,11 +23,16 @@ import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionManager;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.transaction.CDOXATransaction;
+import org.eclipse.emf.cdo.view.CDOFeatureAnalyzer;
+import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
import org.eclipse.emf.cdo.view.CDORevisionPrefetchingPolicy;
import org.eclipse.emf.cdo.view.CDOStaleObject;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewSet;
+import org.eclipse.emf.internal.cdo.analyzer.CDOFeatureAnalyzerModelBased;
+import org.eclipse.emf.internal.cdo.analyzer.CDOFeatureAnalyzerUI;
+import org.eclipse.emf.internal.cdo.analyzer.CDOFetchRuleManagerThreadLocal;
import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.messages.Messages;
import org.eclipse.emf.internal.cdo.object.CDOFactoryImpl;
@@ -167,6 +172,14 @@ public final class CDOUtil
/**
* @since 2.0
*/
+ public static CDOCollectionLoadingPolicy createCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize)
+ {
+ return new CDOCollectionLoadingPolicyImpl(initialChunkSize, resolveChunkSize);
+ }
+
+ /**
+ * @since 2.0
+ */
public static CDORevisionPrefetchingPolicy createRevisionPrefetchingPolicy(int chunkSize)
{
if (chunkSize <= 0)
@@ -178,11 +191,35 @@ public final class CDOUtil
}
/**
- * @since 2.0
+ * @since 4.1
*/
- public static CDOCollectionLoadingPolicy createCollectionLoadingPolicy(int initialChunkSize, int resolveChunkSize)
+ public static CDOFetchRuleManager createThreadLocalFetchRuleManager()
{
- return new CDOCollectionLoadingPolicyImpl(initialChunkSize, resolveChunkSize);
+ return new CDOFetchRuleManagerThreadLocal();
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static CDOFeatureAnalyzer createModelBasedFeatureAnalyzer()
+ {
+ return new CDOFeatureAnalyzerModelBased();
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static CDOFeatureAnalyzer createUIFeatureAnalyzer()
+ {
+ return new CDOFeatureAnalyzerUI();
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static CDOFeatureAnalyzer createUIFeatureAnalyzer(long maxTimeBetweenOperation)
+ {
+ return new CDOFeatureAnalyzerUI(maxTimeBetweenOperation);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOFetchRuleManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOFetchRuleManager.java
index 3c86e4a847..c53ecac2e3 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOFetchRuleManager.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOFetchRuleManager.java
@@ -28,6 +28,7 @@ import java.util.List;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
+// TODO Move to package org.eclipse.emf.cdo.session
public interface CDOFetchRuleManager
{
public CDOID getContext();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
index 847dc118a3..26a842c237 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOView.java
@@ -633,6 +633,16 @@ public interface CDOView extends CDOCommonView, CDOUpdatable, INotifier
public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy);
/**
+ * @since 4.1
+ */
+ public CDOFeatureAnalyzer getFeatureAnalyzer();
+
+ /**
+ * @since 4.1
+ */
+ public void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer);
+
+ /**
* An {@link IOptionsEvent options event} fired from view {@link CDOView#options() options} when the
* {@link Options#setLoadNotificationEnabled(boolean) load notification enabled} option has changed.
*
@@ -746,5 +756,15 @@ public interface CDOView extends CDOCommonView, CDOUpdatable, INotifier
public interface RevisionPrefetchingPolicyEvent extends IOptionsEvent
{
}
+
+ /**
+ * @author Eike Stepper
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @since 4.1
+ */
+ public interface FeatureAnalyzerEvent extends IOptionsEvent
+ {
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
index 9f9a3540d0..4e2c8090ad 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionConfigurationImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
+import org.eclipse.emf.cdo.view.CDOFetchRuleManager;
import org.eclipse.emf.internal.cdo.messages.Messages;
@@ -52,6 +53,8 @@ public abstract class CDOSessionConfigurationImpl extends Notifier implements In
private CDOIDGenerator idGenerator;
+ private CDOFetchRuleManager fetchRuleManager;
+
private InternalCDOBranchManager branchManager;
private InternalCDOPackageRegistry packageRegistry;
@@ -172,6 +175,17 @@ public abstract class CDOSessionConfigurationImpl extends Notifier implements In
this.idGenerator = idGenerator;
}
+ public CDOFetchRuleManager getFetchRuleManager()
+ {
+ return fetchRuleManager;
+ }
+
+ public void setFetchRuleManager(CDOFetchRuleManager fetchRuleManager)
+ {
+ checkNotOpen();
+ this.fetchRuleManager = fetchRuleManager;
+ }
+
public InternalCDOBranchManager getBranchManager()
{
return branchManager;
@@ -295,6 +309,7 @@ public abstract class CDOSessionConfigurationImpl extends Notifier implements In
session.setMainBranchLocal(mainBranchLocal);
session.setExceptionHandler(exceptionHandler);
+ session.setFetchRuleManager(fetchRuleManager);
session.setIDGenerator(idGenerator);
session.setAuthenticator(authenticator);
session.setRevisionManager(revisionManager);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index c4c25661d6..90d7d4a3f8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -182,13 +182,7 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
private CDORepositoryInfo repositoryInfo;
- private CDOFetchRuleManager ruleManager = new NOOPFetchRuleManager()
- {
- public CDOCollectionLoadingPolicy getCollectionLoadingPolicy()
- {
- return options().getCollectionLoadingPolicy();
- }
- };
+ private CDOFetchRuleManager fetchRuleManager;
private IRWOLockManager<CDOSessionImpl, Object> lockManager = new RWOLockManager<CDOSessionImpl, Object>();
@@ -344,7 +338,7 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
*/
public CDOFetchRuleManager getFetchRuleManager()
{
- return ruleManager;
+ return fetchRuleManager;
}
/**
@@ -352,7 +346,18 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
*/
public void setFetchRuleManager(CDOFetchRuleManager fetchRuleManager)
{
- ruleManager = fetchRuleManager;
+ if (fetchRuleManager == null)
+ {
+ fetchRuleManager = new NOOPFetchRuleManager()
+ {
+ public CDOCollectionLoadingPolicy getCollectionLoadingPolicy()
+ {
+ return options().getCollectionLoadingPolicy();
+ }
+ };
+ }
+
+ this.fetchRuleManager = fetchRuleManager;
}
public CDOAuthenticator getAuthenticator()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
index 82a57ba2b4..a469df7b8d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.cdo.internal.common.revision.delta.CDOUnsetFeatureDeltaIm
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
import org.eclipse.emf.cdo.util.ObjectNotFoundException;
+import org.eclipse.emf.cdo.view.CDOFeatureAnalyzer;
import org.eclipse.emf.cdo.view.CDORevisionPrefetchingPolicy;
import org.eclipse.emf.internal.cdo.bundle.OM;
@@ -180,13 +181,15 @@ public final class CDOStoreImpl implements CDOStore
TRACER.format("get({0}, {1}, {2})", cdoObject, feature, index); //$NON-NLS-1$
}
- view.getFeatureAnalyzer().preTraverseFeature(cdoObject, feature, index);
+ CDOFeatureAnalyzer featureAnalyzer = view.options().getFeatureAnalyzer();
+
+ featureAnalyzer.preTraverseFeature(cdoObject, feature, index);
InternalCDORevision revision = getRevisionForReading(cdoObject);
Object value = revision.get(feature, index);
value = convertToEMF(eObject, revision, feature, index, value);
- view.getFeatureAnalyzer().postTraverseFeature(cdoObject, feature, index, value);
+ featureAnalyzer.postTraverseFeature(cdoObject, feature, index, value);
return value;
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 4988ba0e5f..3e7a57bab8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -119,8 +119,6 @@ public class CDOViewImpl extends AbstractCDOView
private String durableLockingID;
- private CDOFeatureAnalyzer featureAnalyzer = CDOFeatureAnalyzer.NOOP;
-
private ChangeSubscriptionManager changeSubscriptionManager = new ChangeSubscriptionManager();
private AdapterManager adapterManager = new AdapterManager();
@@ -652,17 +650,19 @@ public class CDOViewImpl extends AbstractCDOView
/**
* @since 2.0
*/
+ @Deprecated
public synchronized CDOFeatureAnalyzer getFeatureAnalyzer()
{
- return featureAnalyzer;
+ return options().getFeatureAnalyzer();
}
/**
* @since 2.0
*/
+ @Deprecated
public synchronized void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer)
{
- this.featureAnalyzer = featureAnalyzer == null ? CDOFeatureAnalyzer.NOOP : featureAnalyzer;
+ options.setFeatureAnalyzer(featureAnalyzer);
}
/**
@@ -1120,7 +1120,6 @@ public class CDOViewImpl extends AbstractCDOView
}
changeSubscriptionManager = null;
- featureAnalyzer = null;
options = null;
super.doDeactivate();
}
@@ -1633,6 +1632,8 @@ public class CDOViewImpl extends AbstractCDOView
private CDORevisionPrefetchingPolicy revisionPrefetchingPolicy = CDOUtil
.createRevisionPrefetchingPolicy(NO_REVISION_PREFETCHING);
+ private CDOFeatureAnalyzer featureAnalyzer = CDOFeatureAnalyzer.NOOP;
+
private CDOStaleReferencePolicy staleReferencePolicy = CDOStaleReferencePolicy.EXCEPTION;
private HashBag<CDOAdapterPolicy> changeSubscriptionPolicies = new HashBag<CDOAdapterPolicy>();
@@ -1843,6 +1844,34 @@ public class CDOViewImpl extends AbstractCDOView
fireEvent(event);
}
+ public CDOFeatureAnalyzer getFeatureAnalyzer()
+ {
+ synchronized (CDOViewImpl.this)
+ {
+ return featureAnalyzer;
+ }
+ }
+
+ public void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer)
+ {
+ if (featureAnalyzer == null)
+ {
+ featureAnalyzer = CDOFeatureAnalyzer.NOOP;
+ }
+
+ IEvent event = null;
+ synchronized (CDOViewImpl.this)
+ {
+ if (this.featureAnalyzer != featureAnalyzer)
+ {
+ this.featureAnalyzer = featureAnalyzer;
+ event = new FeatureAnalyzerEventImpl();
+ }
+ }
+
+ fireEvent(event);
+ }
+
@Deprecated
public CDOStaleReferencePolicy getStaleReferenceBehaviour()
{
@@ -2086,6 +2115,19 @@ public class CDOViewImpl extends AbstractCDOView
/**
* @author Eike Stepper
*/
+ private final class FeatureAnalyzerEventImpl extends OptionsEvent implements FeatureAnalyzerEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ public FeatureAnalyzerEventImpl()
+ {
+ super(OptionsImpl.this);
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
@SuppressWarnings("deprecation")
private final class ReferencePolicyEventImpl extends OptionsEvent implements ReferencePolicyEvent
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
index 0d694c11a7..0a5ae90a4f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
@@ -52,8 +52,10 @@ public interface InternalCDOView extends CDOView, CDOIDProvider, ILifecycle
public void setViewSet(InternalCDOViewSet viewSet);
+ @Deprecated
public CDOFeatureAnalyzer getFeatureAnalyzer();
+ @Deprecated
public void setFeatureAnalyzer(CDOFeatureAnalyzer featureAnalyzer);
/**

Back to the top