### Eclipse Workspace Patch 1.0 #P org.eclipse.emf.cdo.server Index: src/org/eclipse/emf/cdo/internal/server/Session.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java,v retrieving revision 1.64 diff -u -r1.64 Session.java --- src/org/eclipse/emf/cdo/internal/server/Session.java 12 Nov 2008 17:42:14 -0000 1.64 +++ src/org/eclipse/emf/cdo/internal/server/Session.java 6 Dec 2008 15:45:53 -0000 @@ -14,6 +14,7 @@ **************************************************************************/ package org.eclipse.emf.cdo.internal.server; +import org.eclipse.emf.cdo.common.CDOProtocolSession; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.id.CDOIDAndVersion; import org.eclipse.emf.cdo.common.id.CDOIDProvider; @@ -56,7 +57,8 @@ /** * @author Eike Stepper */ -public class Session extends Container implements ISession, CDOIDProvider, CDOPackageURICompressor +public class Session extends Container implements ISession, CDOIDProvider, CDOPackageURICompressor, + CDOProtocolSession.Options { private SessionManager sessionManager; @@ -102,6 +104,14 @@ } } + /** + * @since 2.0 + */ + public Options getOptions() + { + return this; + } + public SessionManager getSessionManager() { return sessionManager; #P org.eclipse.emf.cdo.common Index: src/org/eclipse/emf/cdo/common/CDOProtocolSession.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOProtocolSession.java,v retrieving revision 1.6 diff -u -r1.6 CDOProtocolSession.java --- src/org/eclipse/emf/cdo/common/CDOProtocolSession.java 1 Oct 2008 11:59:51 -0000 1.6 +++ src/org/eclipse/emf/cdo/common/CDOProtocolSession.java 6 Dec 2008 15:45:53 -0000 @@ -27,15 +27,23 @@ /** * @since 2.0 */ - public boolean isPassiveUpdateEnabled(); + public void close(); /** * @since 2.0 */ - public void close(); + public boolean isClosed(); /** * @since 2.0 */ - public boolean isClosed(); + public Options getOptions(); + + /** + * @since 2.0 + */ + public interface Options + { + public boolean isPassiveUpdateEnabled(); + } } #P org.eclipse.emf.cdo.tests Index: src/org/eclipse/emf/cdo/tests/AdapterManagerTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AdapterManagerTest.java,v retrieving revision 1.1 diff -u -r1.1 AdapterManagerTest.java --- src/org/eclipse/emf/cdo/tests/AdapterManagerTest.java 6 Dec 2008 15:17:07 -0000 1.1 +++ src/org/eclipse/emf/cdo/tests/AdapterManagerTest.java 6 Dec 2008 15:45:54 -0000 @@ -37,7 +37,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -46,7 +46,7 @@ TestAdapter testAdapter = new TestAdapter(); msg("Opening transaction"); CDOTransaction transaction = session.openTransaction(); - transaction.setCacheReferenceType(ReferenceType.WEAK); + transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); transaction.createResource("/resA").getContents().add(companyA); @@ -71,7 +71,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -80,8 +80,8 @@ TestAdapter testAdapter = new TestAdapter(); msg("Opening transaction"); CDOTransaction transaction = session.openTransaction(); - transaction.setCacheReferenceType(ReferenceType.WEAK); - transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); + transaction.getOptions().setStrongReferencePolicy(CDOAdapterPolicy.ALL); transaction.createResource("/resA").getContents().add(companyA); @@ -107,7 +107,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -119,8 +119,8 @@ msg("Opening transaction"); CDOTransaction transaction = session.openTransaction(); - transaction.setCacheReferenceType(ReferenceType.WEAK); - transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); + transaction.getOptions().setStrongReferencePolicy(CDOAdapterPolicy.ALL); transaction.createResource("/resA").getContents().add(companyA); @@ -146,7 +146,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -160,8 +160,8 @@ msg("Opening transaction"); CDOTransaction transaction = session.openTransaction(); - transaction.setCacheReferenceType(ReferenceType.WEAK); - transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); + transaction.getOptions().setStrongReferencePolicy(CDOAdapterPolicy.ALL); transaction.createResource("/resA").getContents().add(companyA); @@ -192,7 +192,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -204,20 +204,20 @@ msg("Opening transaction"); CDOTransaction transaction = session.openTransaction(); - transaction.setCacheReferenceType(ReferenceType.WEAK); + transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); transaction.createResource("/resA").getContents().add(companyA); msg("Committing"); transaction.commit(); CDOID id = CDOUtil.getCDOObject(companyA).cdoID(); - transaction.setStrongReferencePolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setStrongReferencePolicy(CDOAdapterPolicy.ALL); companyA = null; testAdapter.getNotifications().clear(); System.gc(); assertEquals(true, transaction.isObjectRegistered(id)); - transaction.setStrongReferencePolicy(CDOAdapterPolicy.NONE); + transaction.getOptions().setStrongReferencePolicy(CDOAdapterPolicy.NONE); System.gc(); Index: src/org/eclipse/emf/cdo/tests/ChunkingTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingTest.java,v retrieving revision 1.14 diff -u -r1.14 ChunkingTest.java --- src/org/eclipse/emf/cdo/tests/ChunkingTest.java 28 Oct 2008 14:13:43 -0000 1.14 +++ src/org/eclipse/emf/cdo/tests/ChunkingTest.java 6 Dec 2008 15:45:55 -0000 @@ -56,7 +56,7 @@ // ************************************************************* // CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.getResource("/test1"); @@ -101,7 +101,7 @@ // ************************************************************* // CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.getResource("/test1"); @@ -142,7 +142,7 @@ CDOSession session = openModel1Session(); CDOTransaction transaction = session.openTransaction(); - transaction.setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10)); + transaction.getOptions().setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10)); CDOResource resource = transaction.getResource("/test1"); @@ -179,7 +179,7 @@ // ************************************************************* // CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.getResource("/test1"); @@ -221,7 +221,7 @@ // ************************************************************* // CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); msg("Creating resource"); CDOTransaction transaction = session.openTransaction(); Index: src/org/eclipse/emf/cdo/tests/MultiValuedOfAttributeTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/MultiValuedOfAttributeTest.java,v retrieving revision 1.5 diff -u -r1.5 MultiValuedOfAttributeTest.java --- src/org/eclipse/emf/cdo/tests/MultiValuedOfAttributeTest.java 3 Dec 2008 03:06:11 -0000 1.5 +++ src/org/eclipse/emf/cdo/tests/MultiValuedOfAttributeTest.java 6 Dec 2008 15:45:56 -0000 @@ -200,7 +200,7 @@ { CDOSession session = openSession(getModel5Package()); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(0, 100)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(0, 100)); CDOTransaction transaction = session.openTransaction(); CDOResource resource = transaction.getResource("/res1"); Index: src/org/eclipse/emf/cdo/tests/InvalidationTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/InvalidationTest.java,v retrieving revision 1.25 diff -u -r1.25 InvalidationTest.java --- src/org/eclipse/emf/cdo/tests/InvalidationTest.java 14 Nov 2008 20:15:57 -0000 1.25 +++ src/org/eclipse/emf/cdo/tests/InvalidationTest.java 6 Dec 2008 15:45:55 -0000 @@ -589,7 +589,7 @@ msg("Opening sessionB"); final CDOSession sessionB = openModel1Session(); - sessionB.setPassiveUpdateEnabled(false); + sessionB.getOptions().setPassiveUpdateEnabled(false); msg("Attaching viewB"); final CDOView viewB = sessionB.openTransaction(); @@ -668,7 +668,7 @@ msg("Opening sessionB"); final CDOSession sessionB = openModel1Session(); - sessionB.setPassiveUpdateEnabled(false); + sessionB.getOptions().setPassiveUpdateEnabled(false); msg("Attaching viewB"); final CDOView viewB = sessionB.openTransaction(); @@ -679,7 +679,7 @@ msg("Opening sessionB"); final CDOSession sessionC = openModel1Session(); - assertEquals(true, sessionC.isPassiveUpdateEnabled()); + assertEquals(true, sessionC.getOptions().isPassiveUpdateEnabled()); msg("Attaching viewB"); final CDOView viewC = sessionC.openTransaction(); @@ -719,7 +719,7 @@ assertEquals(false, timeOuterC.timedOut()); // It should refresh the session - sessionB.setPassiveUpdateEnabled(true); + sessionB.getOptions().setPassiveUpdateEnabled(true); msg("Checking after sync"); assertEquals(false, timeOuterB.timedOut()); @@ -784,7 +784,7 @@ msg("Attaching viewB"); final CDOView viewB = sessionB.openTransaction(); - viewB.setInvalidationNotificationEnabled(true); + viewB.getOptions().setInvalidationNotificationEnabled(true); msg("Loading resource"); final CDOResource resourceB = viewB.getResource("/test1"); @@ -864,11 +864,11 @@ msg("Opening sessionB"); final CDOSession sessionB = openModel1Session(); - sessionB.setPassiveUpdateEnabled(false); + sessionB.getOptions().setPassiveUpdateEnabled(false); msg("Attaching viewB"); final CDOView viewB = sessionB.openTransaction(); - viewB.setInvalidationNotificationEnabled(true); + viewB.getOptions().setInvalidationNotificationEnabled(true); msg("Loading resource"); final CDOResource resourceB = viewB.getResource("/test1"); Index: src/org/eclipse/emf/cdo/tests/ViewTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ViewTest.java,v retrieving revision 1.15 diff -u -r1.15 ViewTest.java --- src/org/eclipse/emf/cdo/tests/ViewTest.java 4 Dec 2008 11:33:29 -0000 1.15 +++ src/org/eclipse/emf/cdo/tests/ViewTest.java 6 Dec 2008 15:45:56 -0000 @@ -97,7 +97,7 @@ } CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2)); CDOTransaction transaction = session.openTransaction(); @@ -137,7 +137,7 @@ } CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(2, 2)); CDOTransaction transaction = session.openTransaction(); @@ -229,22 +229,22 @@ transaction.createResource("/my/test5"); boolean done; - done = transaction.setCacheReferenceType(ReferenceType.SOFT); + done = transaction.getOptions().setCacheReferenceType(ReferenceType.SOFT); assertEquals(false, done); - done = transaction.setCacheReferenceType(null); + done = transaction.getOptions().setCacheReferenceType(null); assertEquals(false, done); - done = transaction.setCacheReferenceType(ReferenceType.STRONG); + done = transaction.getOptions().setCacheReferenceType(ReferenceType.STRONG); assertEquals(true, done); - done = transaction.setCacheReferenceType(ReferenceType.SOFT); + done = transaction.getOptions().setCacheReferenceType(ReferenceType.SOFT); assertEquals(true, done); - done = transaction.setCacheReferenceType(ReferenceType.WEAK); + done = transaction.getOptions().setCacheReferenceType(ReferenceType.WEAK); assertEquals(true, done); - done = transaction.setCacheReferenceType(null); + done = transaction.getOptions().setCacheReferenceType(null); assertEquals(true, done); session.close(); Index: src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java,v retrieving revision 1.12 diff -u -r1.12 ChunkingWithMEMTest.java --- src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java 30 Oct 2008 10:53:08 -0000 1.12 +++ src/org/eclipse/emf/cdo/tests/ChunkingWithMEMTest.java 6 Dec 2008 15:45:55 -0000 @@ -69,7 +69,7 @@ msg("Opening session"); CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); msg("Attaching transaction"); CDOTransaction transaction = session.openTransaction(); @@ -128,7 +128,7 @@ msg("Opening session"); CDOSession session = openModel1Session(); - session.setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); + session.getOptions().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(10, 10)); msg("Attaching transaction"); CDOTransaction transaction = session.openTransaction(); Index: src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java,v retrieving revision 1.14 diff -u -r1.14 FetchRuleAnalyzerTest.java --- src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java 14 Nov 2008 20:15:57 -0000 1.14 +++ src/org/eclipse/emf/cdo/tests/FetchRuleAnalyzerTest.java 6 Dec 2008 15:45:55 -0000 @@ -95,7 +95,7 @@ InternalCDOTransaction transaction = (InternalCDOTransaction)session.openTransaction(); CDOFeatureAnalyzerModelBased featureanalyzerModelBased = new CDOFeatureAnalyzerModelBased(); transaction.setFeatureAnalyzer(featureanalyzerModelBased); - transaction.setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10)); + transaction.getOptions().setRevisionPrefetchingPolicy(CDOUtil.createRevisionPrefetchingPolicy(10)); msg("Getting resource"); Index: src/org/eclipse/emf/cdo/tests/LockingManagerTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/LockingManagerTest.java,v retrieving revision 1.2 diff -u -r1.2 LockingManagerTest.java --- src/org/eclipse/emf/cdo/tests/LockingManagerTest.java 12 Nov 2008 17:41:51 -0000 1.2 +++ src/org/eclipse/emf/cdo/tests/LockingManagerTest.java 6 Dec 2008 15:45:55 -0000 @@ -469,7 +469,7 @@ CDOResource res = transaction.createResource("/res1"); res.getContents().add(company); transaction.commit(); - transaction.setAutoReleaseLocksEnabled(false); + transaction.getOptions().setAutoReleaseLocksEnabled(false); CDOObject cdoCompany = CDOUtil.getCDOObject(company); cdoCompany.cdoWriteLock().lock(); @@ -495,7 +495,7 @@ transaction.commit(); assertEquals(true, cdoCompany.cdoReadLock().isLocked()); - transaction.setAutoReleaseLocksEnabled(true); + transaction.getOptions().setAutoReleaseLocksEnabled(true); transaction.commit(); assertEquals(false, cdoCompany.cdoReadLock().isLocked()); } @@ -509,7 +509,7 @@ CDOResource res = transaction.createResource("/res1"); res.getContents().add(company); transaction.commit(); - transaction.setAutoReleaseLocksEnabled(false); + transaction.getOptions().setAutoReleaseLocksEnabled(false); CDOObject cdoCompany = CDOUtil.getCDOObject(company); cdoCompany.cdoWriteLock().lock(); @@ -535,7 +535,7 @@ transaction.rollback(); assertEquals(true, cdoCompany.cdoReadLock().isLocked()); - transaction.setAutoReleaseLocksEnabled(true); + transaction.getOptions().setAutoReleaseLocksEnabled(true); transaction.rollback(); assertEquals(false, cdoCompany.cdoReadLock().isLocked()); } Index: src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java,v retrieving revision 1.5 diff -u -r1.5 ChangeSubscriptionTest.java --- src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java 6 Dec 2008 15:17:07 -0000 1.5 +++ src/org/eclipse/emf/cdo/tests/ChangeSubscriptionTest.java 6 Dec 2008 15:45:54 -0000 @@ -52,7 +52,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -69,7 +69,7 @@ msg("Opening transaction"); final CDOTransaction transaction = session.openTransaction(); - transaction.setChangeSubscriptionPolicy(enabled); + transaction.getOptions().setChangeSubscriptionPolicy(enabled); msg("Creating resource"); final CDOResource resourceA = transaction.createResource("/test1"); @@ -113,7 +113,7 @@ // Switching policy to the other final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL; - transaction.setChangeSubscriptionPolicy(enabled2); + transaction.getOptions().setChangeSubscriptionPolicy(enabled2); adapter.getNotifications().clear(); @@ -155,7 +155,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -171,7 +171,7 @@ msg("Opening transaction"); final CDOTransaction transaction = session.openTransaction(); - transaction.setChangeSubscriptionPolicy(enabled); + transaction.getOptions().setChangeSubscriptionPolicy(enabled); msg("Creating resource"); final CDOResource resourceA = transaction.createResource("/test1"); @@ -188,7 +188,7 @@ msg("Opening view"); final CDOSession session2 = openModel1Session(); - session2.setPassiveUpdateEnabled(false); + session2.getOptions().setPassiveUpdateEnabled(false); final CDOTransaction transaction2 = session2.openTransaction(); @@ -218,7 +218,7 @@ // Switching policy to the other final CDOAdapterPolicy enabled2 = enabled == CDOAdapterPolicy.ALL ? CDOAdapterPolicy.NONE : CDOAdapterPolicy.ALL; - transaction.setChangeSubscriptionPolicy(enabled2); + transaction.getOptions().setChangeSubscriptionPolicy(enabled2); adapter.getNotifications().clear(); @@ -250,7 +250,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -266,7 +266,7 @@ msg("Opening transaction"); final CDOTransaction transaction = session.openTransaction(); - transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); msg("Creating resource"); final CDOResource resourceA = transaction.createResource("/test1"); @@ -284,10 +284,10 @@ msg("Opening view"); final CDOSession session2 = openModel1Session(); - session2.setPassiveUpdateEnabled(false); + session2.getOptions().setPassiveUpdateEnabled(false); final CDOTransaction transaction2 = session2.openTransaction(); - transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); final Category category1B = (Category)transaction2.getObject(CDOUtil.getCDOObject(category1A).cdoID(), true); @@ -320,7 +320,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -337,7 +337,7 @@ msg("Opening transaction"); final CDOTransaction transaction = session.openTransaction(); - transaction.setChangeSubscriptionPolicy(customPolicy); + transaction.getOptions().setChangeSubscriptionPolicy(customPolicy); msg("Creating resource"); final CDOResource resourceA = transaction.createResource("/test1"); @@ -359,7 +359,7 @@ msg("Opening view"); final CDOSession session2 = openModel1Session(); - session2.setPassiveUpdateEnabled(false); + session2.getOptions().setPassiveUpdateEnabled(false); final CDOTransaction transaction2 = session2.openTransaction(); @@ -388,7 +388,7 @@ assertEquals(false, timedOut); // Switching policy to the other - transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); adapter.getNotifications().clear(); @@ -420,7 +420,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // @@ -437,7 +437,7 @@ msg("Opening transaction"); final CDOTransaction transaction = session.openTransaction(); - transaction.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); msg("Creating resource"); final CDOResource resourceA = transaction.createResource("/test1"); @@ -456,7 +456,7 @@ msg("Opening view"); final CDOSession session2 = openModel1Session(); - session2.setPassiveUpdateEnabled(false); + session2.getOptions().setPassiveUpdateEnabled(false); final CDOTransaction transaction2 = session2.openTransaction(); Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250036_Test.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250036_Test.java,v retrieving revision 1.2 diff -u -r1.2 Bugzilla_250036_Test.java --- src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250036_Test.java 9 Oct 2008 11:29:27 -0000 1.2 +++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250036_Test.java 6 Dec 2008 15:45:56 -0000 @@ -75,7 +75,7 @@ } final TestAdapter counter = new TestAdapter(); genRefMap.eAdapters().add(counter); - transaction2.setInvalidationNotificationEnabled(true); + transaction2.getOptions().setInvalidationNotificationEnabled(true); /********* transaction 1 ***************/ for (int i = 10; i < 20; i++) Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251087_Test.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251087_Test.java,v retrieving revision 1.3 diff -u -r1.3 Bugzilla_251087_Test.java --- src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251087_Test.java 6 Dec 2008 15:17:07 -0000 1.3 +++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_251087_Test.java 6 Dec 2008 15:45:56 -0000 @@ -44,8 +44,8 @@ CDOSession session = openModel1Session(); CDOTransaction transaction1 = session.openTransaction(); - transaction1.setInvalidationNotificationEnabled(true); - transaction1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction1.getOptions().setInvalidationNotificationEnabled(true); + transaction1.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); String resourcePath = "/test1"; CDOResource res = transaction1.createResource(resourcePath); @@ -70,8 +70,8 @@ CDOSession sessionB = openModel1Session(); CDOTransaction transaction1 = sessionA.openTransaction(); - transaction1.setInvalidationNotificationEnabled(true); - transaction1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction1.getOptions().setInvalidationNotificationEnabled(true); + transaction1.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); String resourcePath = "/test1"; CDOResource res = transaction1.createResource(resourcePath); @@ -82,8 +82,8 @@ CDOTransaction transB1 = sessionB.openTransaction(); CDOID companyID = CDOUtil.getCDOObject(obj2).cdoID(); Company companyB = (Company)transB1.getObject(companyID); - sessionB.setPassiveUpdateEnabled(false); - transB1.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + sessionB.getOptions().setPassiveUpdateEnabled(false); + transB1.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); final TestAdapter testAdapter = new TestAdapter(); companyB.eAdapters().add(testAdapter); assertEquals(true, ((InternalCDOTransaction)transB1).hasSubscription(companyID)); Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250910_Test.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250910_Test.java,v retrieving revision 1.1 diff -u -r1.1 Bugzilla_250910_Test.java --- src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250910_Test.java 26 Oct 2008 20:18:27 -0000 1.1 +++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_250910_Test.java 6 Dec 2008 15:45:56 -0000 @@ -60,7 +60,7 @@ transaction1.commit(); - transaction2.setInvalidationNotificationEnabled(true); + transaction2.getOptions().setInvalidationNotificationEnabled(true); Company company2 = (Company)transaction2.getObject(id, true); company2.eAdapters().add(testAdapter); Index: src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_254489_Test.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/tests/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_254489_Test.java,v retrieving revision 1.2 diff -u -r1.2 Bugzilla_254489_Test.java --- src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_254489_Test.java 6 Dec 2008 15:17:07 -0000 1.2 +++ src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_254489_Test.java 6 Dec 2008 15:45:56 -0000 @@ -42,7 +42,7 @@ msg("Opening session"); final CDOSession session = openModel1Session(); - session.setPassiveUpdateEnabled(false); + session.getOptions().setPassiveUpdateEnabled(false); // ************************************************************* // msg("Opening transaction"); @@ -55,7 +55,7 @@ transaction1.commit(); - transaction2.setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); + transaction2.getOptions().setChangeSubscriptionPolicy(CDOAdapterPolicy.ALL); CDOResource res2 = transaction2.getResource("/res1"); Company companyA2 = (Company)res2.getContents().get(0); final TestAdapter companyA2Adapter = new TestAdapter(); #P org.eclipse.emf.cdo Index: src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java,v retrieving revision 1.125 diff -u -r1.125 CDOSessionImpl.java --- src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java 26 Nov 2008 13:30:17 -0000 1.125 +++ src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java 6 Dec 2008 15:45:58 -0000 @@ -172,6 +172,14 @@ /** * @since 2.0 */ + public CDOSession.Options getOptions() + { + return this; + } + + /** + * @since 2.0 + */ public String getUserID() { IChannel channel = protocol.getChannel(); Index: src/org/eclipse/emf/internal/cdo/InternalCDOSession.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOSession.java,v retrieving revision 1.1 diff -u -r1.1 InternalCDOSession.java --- src/org/eclipse/emf/internal/cdo/InternalCDOSession.java 14 Nov 2008 20:16:06 -0000 1.1 +++ src/org/eclipse/emf/internal/cdo/InternalCDOSession.java 6 Dec 2008 15:45:59 -0000 @@ -33,7 +33,7 @@ * @since 2.0 */ public interface InternalCDOSession extends CDOSession, CDOIDObjectFactory, CDOPackageURICompressor, - ILifecycle.Introspection + ILifecycle.Introspection, CDOSession.Options { public CDOSessionProtocol getProtocol(); Index: src/org/eclipse/emf/internal/cdo/CDOViewImpl.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java,v retrieving revision 1.171 diff -u -r1.171 CDOViewImpl.java --- src/org/eclipse/emf/internal/cdo/CDOViewImpl.java 6 Dec 2008 15:19:01 -0000 1.171 +++ src/org/eclipse/emf/internal/cdo/CDOViewImpl.java 6 Dec 2008 15:45:59 -0000 @@ -171,6 +171,14 @@ /** * @since 2.0 */ + public Options getOptions() + { + return this; + } + + /** + * @since 2.0 + */ public InternalCDOViewSet getViewSet() { return viewSet; Index: src/org/eclipse/emf/internal/cdo/InternalCDOTransaction.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOTransaction.java,v retrieving revision 1.4 diff -u -r1.4 InternalCDOTransaction.java --- src/org/eclipse/emf/internal/cdo/InternalCDOTransaction.java 6 Dec 2008 15:17:12 -0000 1.4 +++ src/org/eclipse/emf/internal/cdo/InternalCDOTransaction.java 6 Dec 2008 15:45:59 -0000 @@ -23,7 +23,7 @@ * @author Simon McDuff * @since 2.0 */ -public interface InternalCDOTransaction extends CDOTransaction, InternalCDOView +public interface InternalCDOTransaction extends CDOTransaction, InternalCDOView, CDOTransaction.Options { public InternalCDOCommitContext createCommitContext(); Index: src/org/eclipse/emf/internal/cdo/InternalCDOView.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/InternalCDOView.java,v retrieving revision 1.2 diff -u -r1.2 InternalCDOView.java --- src/org/eclipse/emf/internal/cdo/InternalCDOView.java 6 Dec 2008 15:17:12 -0000 1.2 +++ src/org/eclipse/emf/internal/cdo/InternalCDOView.java 6 Dec 2008 15:45:59 -0000 @@ -32,7 +32,7 @@ * @author Eike Stepper * @since 2.0 */ -public interface InternalCDOView extends CDOView, CDOIDProvider +public interface InternalCDOView extends CDOView, CDOIDProvider, CDOView.Options { public InternalCDOSession getSession(); Index: src/org/eclipse/emf/internal/cdo/CDOStore.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java,v retrieving revision 1.71 diff -u -r1.71 CDOStore.java --- src/org/eclipse/emf/internal/cdo/CDOStore.java 27 Nov 2008 05:57:21 -0000 1.71 +++ src/org/eclipse/emf/internal/cdo/CDOStore.java 6 Dec 2008 15:45:58 -0000 @@ -367,7 +367,7 @@ CDOID id = (CDOID)value; CDOList list = revision.getList(cdoFeature); CDORevisionManagerImpl revisionManager = (CDORevisionManagerImpl)view.getSession().getRevisionManager(); - CDORevisionPrefetchingPolicy policy = view.getRevisionPrefetchingPolicy(); + CDORevisionPrefetchingPolicy policy = view.getOptions().getRevisionPrefetchingPolicy(); Collection listOfIDs = policy.loadAhead(revisionManager, eObject, eFeature, list, index, id); if (!listOfIDs.isEmpty()) { Index: src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java,v retrieving revision 1.89 diff -u -r1.89 CDOTransactionImpl.java --- src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java 6 Dec 2008 15:17:12 -0000 1.89 +++ src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java 6 Dec 2008 15:45:59 -0000 @@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.CDOSavepoint; import org.eclipse.emf.cdo.CDOState; +import org.eclipse.emf.cdo.CDOTransaction; import org.eclipse.emf.cdo.CDOTransactionConflictEvent; import org.eclipse.emf.cdo.CDOTransactionFinishedEvent; import org.eclipse.emf.cdo.CDOTransactionHandler; @@ -114,6 +115,15 @@ return Type.TRANSACTION; } + /** + * @since 2.0 + */ + @Override + public CDOTransaction.Options getOptions() + { + return this; + } + public void addHandler(CDOTransactionHandler handler) { synchronized (handlers) Index: src/org/eclipse/emf/cdo/CDOView.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java,v retrieving revision 1.61 diff -u -r1.61 CDOView.java --- src/org/eclipse/emf/cdo/CDOView.java 6 Dec 2008 15:17:12 -0000 1.61 +++ src/org/eclipse/emf/cdo/CDOView.java 6 Dec 2008 15:45:57 -0000 @@ -168,98 +168,6 @@ public boolean hasConflict(); /** - * Sets the type of references to be used in the internal object cache to either {@link ReferenceType#STRONG STRONG}, - * {@link ReferenceType#SOFT SOFT} or {@link ReferenceType#WEAK WEAK}. If null is passed the default - * reference type {@link ReferenceType#SOFT SOFT} is set. If the given reference type does not differ from the one - * being currently set the new value is ignored and false is returned. Otherwise existing object - * references are converted to the new type and true is returned. - * - * @since 2.0 - */ - public boolean setCacheReferenceType(ReferenceType referenceType); - - /** - * Returns true if the {@link CDOObject objects} in this view will notify their - * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are invalidated (due to - * remote changes), false otherwise. - * - * @see CDOInvalidationNotification - * @since 2.0 - */ - public boolean isInvalidationNotificationEnabled(); - - /** - * Specifies whether the {@link CDOObject objects} in this view will notify their - * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are invalidated (due to - * remote changes) or not. - * - * @see CDOInvalidationNotification - * @since 2.0 - */ - public void setInvalidationNotificationEnabled(boolean enabled); - - /** - * Returns the current {@link CDOAdapterPolicy change subscription policy}. - * - * @return The current change subscription policy, never null. - * @see #setChangeSubscriptionPolicy(CDOAdapterPolicy) - * @since 2.0 - */ - public CDOAdapterPolicy getChangeSubscriptionPolicy(); - - /** - * Specifies the change subscription policy. By default, the value is set to {@link CDOAdapterPolicy#NONE}. - *

- * To activate the policy, you must do the following:
- * view.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL); - *

- * To register an object, you must add an adapter to the object in which you are interested:
- * eObject.eAdapters().add(myAdapter); - *

- * By activating this feature, each object having at least one adapter that matches the current policy will be - * registered with the server and will be notified for each change occurring in the scope of any other transaction. - *

- * {@link CDOAdapterPolicy#NONE} - Disabled.
- * {@link CDOAdapterPolicy#ALL} - Enabled for all adapters used.
- * {@link CDOAdapterPolicy#ONLY_CDO_ADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}.
- * Any other class that implement {@link CDOAdapterPolicy} will enable for whatever rules defined in that class.
- *

- * If myAdapter in the above example matches the current policy, eObject will be registered - * with the server and you will receive all changes from other transaction. - *

- * When the policy is changed all objects in the cache will automatically be recalculated. - *

- * You can subscribe to temporary objects. Even if you cannot receive notifications from other {@link CDOTransaction} - * for these because they are only local to you, at commit time these objects will be registered automatically. - *

- * Note: It can be used with CDOSession.setPassiveUpdate(false). In this case, it will receive - * changes without having the objects changed. - * - * @since 2.0 - */ - public void setChangeSubscriptionPolicy(CDOAdapterPolicy policy); - - /** - * @since 2.0 - */ - public CDOAdapterPolicy getStrongReferencePolicy(); - - /** - * @since 2.0 - */ - public void setStrongReferencePolicy(CDOAdapterPolicy policy); - - /** - * @since 2.0 - */ - public CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy(); - - /** - * @since 2.0 - */ - public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy); - - /** * Returns true if a resource with the given path exists in the repository, false. * * @see #getResource(String, boolean) @@ -379,4 +287,111 @@ * @since 2.0 */ public CDOQuery createQuery(String language, String queryString); + + /** + * @since 2.0 + */ + public Options getOptions(); + + /** + * @since 2.0 + */ + public interface Options + { + + /** + * Sets the type of references to be used in the internal object cache to either {@link ReferenceType#STRONG STRONG} + * , {@link ReferenceType#SOFT SOFT} or {@link ReferenceType#WEAK WEAK}. If null is passed the default + * reference type {@link ReferenceType#SOFT SOFT} is set. If the given reference type does not differ from the one + * being currently set the new value is ignored and false is returned. Otherwise existing object + * references are converted to the new type and true is returned. + * + * @since 2.0 + */ + public boolean setCacheReferenceType(ReferenceType referenceType); + + /** + * Returns true if the {@link CDOObject objects} in this view will notify their + * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are invalidated (due to + * remote changes), false otherwise. + * + * @see CDOInvalidationNotification + * @since 2.0 + */ + public boolean isInvalidationNotificationEnabled(); + + /** + * Specifies whether the {@link CDOObject objects} in this view will notify their + * {@link org.eclipse.emf.common.notify.Adapter adapters} about the fact that they are invalidated (due to + * remote changes) or not. + * + * @see CDOInvalidationNotification + * @since 2.0 + */ + public void setInvalidationNotificationEnabled(boolean enabled); + + /** + * Returns the current {@link CDOAdapterPolicy change subscription policy}. + * + * @return The current change subscription policy, never null. + * @see #setChangeSubscriptionPolicy(CDOAdapterPolicy) + * @since 2.0 + */ + public CDOAdapterPolicy getChangeSubscriptionPolicy(); + + /** + * Specifies the change subscription policy. By default, the value is set to {@link CDOAdapterPolicy#NONE}. + *

+ * To activate the policy, you must do the following:
+ * view.setChangeSubscriptionPolicy(CDOChangeSubscriptionPolicy.ALL); + *

+ * To register an object, you must add an adapter to the object in which you are interested:
+ * eObject.eAdapters().add(myAdapter); + *

+ * By activating this feature, each object having at least one adapter that matches the current policy will be + * registered with the server and will be notified for each change occurring in the scope of any other transaction. + *

+ * {@link CDOAdapterPolicy#NONE} - Disabled.
+ * {@link CDOAdapterPolicy#ALL} - Enabled for all adapters used.
+ * {@link CDOAdapterPolicy#ONLY_CDO_ADAPTER} - Enabled only for adapters that implement {@link CDOAdapter}.
+ * Any other class that implement {@link CDOAdapterPolicy} will enable for whatever rules defined in that class. + *
+ *

+ * If myAdapter in the above example matches the current policy, eObject will be + * registered with the server and you will receive all changes from other transaction. + *

+ * When the policy is changed all objects in the cache will automatically be recalculated. + *

+ * You can subscribe to temporary objects. Even if you cannot receive notifications from other + * {@link CDOTransaction} for these because they are only local to you, at commit time these objects will be + * registered automatically. + *

+ * Note: It can be used with CDOSession.setPassiveUpdate(false). In this case, it will receive + * changes without having the objects changed. + * + * @since 2.0 + */ + public void setChangeSubscriptionPolicy(CDOAdapterPolicy policy); + + /** + * @since 2.0 + */ + public CDOAdapterPolicy getStrongReferencePolicy(); + + /** + * @since 2.0 + */ + public void setStrongReferencePolicy(CDOAdapterPolicy policy); + + /** + * @since 2.0 + */ + public CDORevisionPrefetchingPolicy getRevisionPrefetchingPolicy(); + + /** + * @since 2.0 + */ + public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy); + + } } Index: src/org/eclipse/emf/cdo/CDOSession.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOSession.java,v retrieving revision 1.33 diff -u -r1.33 CDOSession.java --- src/org/eclipse/emf/cdo/CDOSession.java 26 Nov 2008 13:30:17 -0000 1.33 +++ src/org/eclipse/emf/cdo/CDOSession.java 6 Dec 2008 15:45:57 -0000 @@ -63,33 +63,6 @@ public CDORevisionManager getRevisionManager(); - /** - * @since 2.0 - */ - public CDOCollectionLoadingPolicy getCollectionLoadingPolicy(); - - /** - * @since 2.0 - */ - public void setCollectionLoadingPolicy(CDOCollectionLoadingPolicy policy); - - /** - * Specifies whether objects will be invalidated due by other users changes. - *

- * E.g.: session.setPassiveUpdateEnabled(false); - *

- * By default this property is enabled. If this property is disabled the latest versions of objects can still be - * obtained by calling {@link #refresh()}. - *

- * Passive update can be disabled in cases where more performance is needed and/or more control over when objects will - * be refreshed. - *

- * When enabled again, a refresh will be automatically performed to be in sync with the server. - * - * @since 2.0 - */ - public void setPassiveUpdateEnabled(boolean enabled); - public CDOView[] getViews(); public CDOTransaction openTransaction(ResourceSet resourceSet); @@ -114,4 +87,44 @@ * @since 2.0 */ public Collection refresh(); + + /** + * @since 2.0 + */ + public CDOSession.Options getOptions(); + + /** + * @since 2.0 + */ + public interface Options extends CDOProtocolSession.Options + { + + /** + * @since 2.0 + */ + public CDOCollectionLoadingPolicy getCollectionLoadingPolicy(); + + /** + * @since 2.0 + */ + public void setCollectionLoadingPolicy(CDOCollectionLoadingPolicy policy); + + /** + * Specifies whether objects will be invalidated due by other users changes. + *

+ * E.g.: session.setPassiveUpdateEnabled(false); + *

+ * By default this property is enabled. If this property is disabled the latest versions of objects can still be + * obtained by calling {@link #refresh()}. + *

+ * Passive update can be disabled in cases where more performance is needed and/or more control over when objects + * will be refreshed. + *

+ * When enabled again, a refresh will be automatically performed to be in sync with the server. + * + * @since 2.0 + */ + public void setPassiveUpdateEnabled(boolean enabled); + + } } Index: src/org/eclipse/emf/cdo/CDOTransaction.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOTransaction.java,v retrieving revision 1.27 diff -u -r1.27 CDOTransaction.java --- src/org/eclipse/emf/cdo/CDOTransaction.java 9 Nov 2008 19:43:28 -0000 1.27 +++ src/org/eclipse/emf/cdo/CDOTransaction.java 6 Dec 2008 15:45:57 -0000 @@ -34,32 +34,6 @@ { public static final long DEFAULT_COMMIT_TIMEOUT = 100000L; - public long getCommitTimeout(); - - public void setCommitTimeout(long timeout); - - /** - * Specifies whether locks in this view will be removed when {@link CDOTransaction#commit()} or - * {@link CDOTransaction#rollback()} is called. - *

- * If false all locks are kept. - *

- * Default value is true. - * - * @since 2.0 - */ - public boolean setAutoReleaseLocksEnabled(boolean on); - - /** - * Returns true if locks in this view will be removes when {@link CDOTransaction#commit()} or - * {@link CDOTransaction#rollback()} is called. - *

- * Default value is true. - * - * @since 2.0 - */ - public boolean isAutoReleaseLocksEnabled(); - /** * @since 2.0 */ @@ -109,4 +83,42 @@ * @since 2.0 */ public Map getDetachedObjects(); + + /** + * @since 2.0 + */ + public Options getOptions(); + + /** + * @since 2.0 + */ + public interface Options extends CDOView.Options + { + + /** + * Specifies whether locks in this view will be removed when {@link CDOTransaction#commit()} or + * {@link CDOTransaction#rollback()} is called. + *

+ * If false all locks are kept. + *

+ * Default value is true. + * + * @since 2.0 + */ + public boolean setAutoReleaseLocksEnabled(boolean on); + + /** + * Returns true if locks in this view will be removes when {@link CDOTransaction#commit()} or + * {@link CDOTransaction#rollback()} is called. + *

+ * Default value is true. + * + * @since 2.0 + */ + public boolean isAutoReleaseLocksEnabled(); + + public long getCommitTimeout(); + + public void setCommitTimeout(long timeout); + } } Index: src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java,v retrieving revision 1.59 diff -u -r1.59 CommitTransactionRequest.java --- src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java 6 Dec 2008 15:17:12 -0000 1.59 +++ src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java 6 Dec 2008 15:45:59 -0000 @@ -203,7 +203,7 @@ Collection revisionDeltas = commitContext.getRevisionDeltas().values(); Collection detachedObjects = commitContext.getDetachedObjects().keySet(); - out.writeBoolean(commitContext.getTransaction().isAutoReleaseLocksEnabled()); + out.writeBoolean(commitContext.getTransaction().getOptions().isAutoReleaseLocksEnabled()); out.writeInt(newPackages.size()); out.writeInt(newResources.size() + newObjects.size()); out.writeInt(revisionDeltas.size()); Index: src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java =================================================================== RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf.cdo/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java,v retrieving revision 1.10 diff -u -r1.10 CDOAbstractFeatureRuleAnalyzer.java --- src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java 19 Oct 2008 08:16:20 -0000 1.10 +++ src/org/eclipse/emf/internal/cdo/analyzer/CDOAbstractFeatureRuleAnalyzer.java 6 Dec 2008 15:45:59 -0000 @@ -67,7 +67,7 @@ TRACER.format("preTraverseFeature : {0}.{1}", cdoObject.cdoClass(), feature.getName()); } - loadCollectionPolicy = cdoObject.cdoView().getSession().getCollectionLoadingPolicy(); + loadCollectionPolicy = cdoObject.cdoView().getSession().getOptions().getCollectionLoadingPolicy(); lastTraverseFeature = feature; lastTraverseCDOObject = cdoObject; lastTraverseIndex = index;