diff options
author | Eike Stepper | 2009-07-11 06:35:02 +0000 |
---|---|---|
committer | Eike Stepper | 2009-07-11 06:35:02 +0000 |
commit | 24a7797dd3f8168e4f25be57f01fd5a585401910 (patch) | |
tree | 8e2eda89a20bb43352e974183bdbeba16e98e823 | |
parent | 81d94805548152b0a4544376ff520a13638f2248 (diff) | |
download | cdo-24a7797dd3f8168e4f25be57f01fd5a585401910.tar.gz cdo-24a7797dd3f8168e4f25be57f01fd5a585401910.tar.xz cdo-24a7797dd3f8168e4f25be57f01fd5a585401910.zip |
[282481] Provide an EmbeddedSessionProtocol
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282481
9 files changed, 46 insertions, 76 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java index 19d0bd9925..081a4e1d46 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/CDOCommonSession.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Eike Stepper - initial API and implementation */ @@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.common; import org.eclipse.net4j.util.collection.Closeable; import org.eclipse.net4j.util.options.IOptions; import org.eclipse.net4j.util.options.IOptionsContainer; +import org.eclipse.net4j.util.options.IOptionsEvent; import org.eclipse.net4j.util.security.IUserAware; /** @@ -35,5 +36,32 @@ public interface CDOCommonSession extends IUserAware, IOptionsContainer, Closeab public interface Options extends IOptions { public boolean isPassiveUpdateEnabled(); + + /** + * Specifies whether objects will be invalidated due by other users changes. + * <p> + * Example: + * <p> + * <code>session.setPassiveUpdateEnabled(false);</code> + * <p> + * By default this property is enabled. If this property is disabled the latest versions of objects can still be + * obtained by calling {@link #refresh()}. + * <p> + * Passive update can be disabled in cases where more performance is needed and/or more control over when objects + * will be refreshed. + * <p> + * When enabled again, a refresh will be automatically performed to be in sync with the server. + * + * @since 3.0 + */ + public void setPassiveUpdateEnabled(boolean enabled); + + /** + * @author Eike Stepper + * @since 3.0 + */ + public interface PassiveUpdateEvent extends IOptionsEvent + { + } } } diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java index bf6cb86b62..42096180da 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java @@ -42,8 +42,6 @@ public interface InternalSession extends ISession, CDOIDProvider, CDOCommonSessi public ITransaction openTransaction(int viewID); - public void setPassiveUpdateEnabled(boolean passiveUpdateEnabled); - public void viewClosed(InternalView view); public void setSubscribed(boolean subscribed); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java index 41f0ffc9fc..17adb2b148 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSession.java @@ -20,7 +20,6 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionManager; import org.eclipse.emf.cdo.session.remote.CDORemoteSessionManager; import org.eclipse.emf.cdo.transaction.CDOTimeStampContext; import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.CDOEvent; import org.eclipse.emf.cdo.view.CDOAudit; import org.eclipse.emf.cdo.view.CDOFetchRuleManager; import org.eclipse.emf.cdo.view.CDOView; @@ -177,23 +176,6 @@ public interface CDOSession extends CDOCommonSession, IContainer<CDOView>, IOpti public void setGeneratedPackageEmulationEnabled(boolean generatedPackageEmulationEnabled); /** - * Specifies whether objects will be invalidated due by other users changes. - * <p> - * Example: - * <p> - * <code>session.setPassiveUpdateEnabled(false);</code> - * <p> - * By default this property is enabled. If this property is disabled the latest versions of objects can still be - * obtained by calling {@link #refresh()}. - * <p> - * Passive update can be disabled in cases where more performance is needed and/or more control over when objects - * will be refreshed. - * <p> - * When enabled again, a refresh will be automatically performed to be in sync with the server. - */ - public void setPassiveUpdateEnabled(boolean enabled); - - /** * The {@link CDOCollectionLoadingPolicy collection loading policy} of this {@link CDOSession session} controls how * a list gets populated. By default, when an object is fetched, all its elements are filled with the proper values. * <p> @@ -206,7 +188,7 @@ public interface CDOSession extends CDOCommonSession, IContainer<CDOView>, IOpti * </ol> * Example: * <p> - * <code>CDONet4jUtil.createCollectionLoadingPolicy(initialElements, subsequentElements);</code> + * <code>CDOUtil.createCollectionLoadingPolicy(initialElements, subsequentElements);</code> * <p> * The user can also provide its own implementation of the CDOCollectionLoadingPolicy interface. */ @@ -220,21 +202,14 @@ public interface CDOSession extends CDOCommonSession, IContainer<CDOView>, IOpti /** * @author Eike Stepper */ - public interface GeneratedPackageEmulationEvent extends IOptionsEvent, CDOEvent - { - } - - /** - * @author Eike Stepper - */ - public interface PassiveUpdateEvent extends IOptionsEvent, CDOEvent + public interface GeneratedPackageEmulationEvent extends IOptionsEvent { } /** * @author Eike Stepper */ - public interface CollectionLoadingPolicyEvent extends IOptionsEvent, CDOEvent + public interface CollectionLoadingPolicyEvent extends IOptionsEvent { } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionEvent.java index 3f3084a3a2..18e353f01a 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionEvent.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/CDOSessionEvent.java @@ -10,14 +10,14 @@ */ package org.eclipse.emf.cdo.session; -import org.eclipse.emf.cdo.util.CDOEvent; +import org.eclipse.net4j.util.event.IEvent; /** * @author Eike Stepper * @noimplement This interface is not intended to be implemented by clients. * @since 2.0 */ -public interface CDOSessionEvent extends CDOEvent +public interface CDOSessionEvent extends IEvent { /** * @since 3.0 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/remote/CDORemoteSessionEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/remote/CDORemoteSessionEvent.java index e69f160bd4..fefde1b6a8 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/remote/CDORemoteSessionEvent.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/session/remote/CDORemoteSessionEvent.java @@ -4,19 +4,19 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Eike Stepper - initial API and implementation */ package org.eclipse.emf.cdo.session.remote; -import org.eclipse.emf.cdo.util.CDOEvent; +import org.eclipse.net4j.util.event.IEvent; /** * @author Eike Stepper * @since 2.0 */ -public interface CDORemoteSessionEvent extends CDOEvent +public interface CDORemoteSessionEvent extends IEvent { public CDORemoteSession getRemoteSession(); diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java index 79d0ae5f58..18423e7056 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/transaction/CDOTransaction.java @@ -18,7 +18,6 @@ import org.eclipse.emf.cdo.CDOObject; import org.eclipse.emf.cdo.common.id.CDOID; import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta; import org.eclipse.emf.cdo.eresource.CDOResource; -import org.eclipse.emf.cdo.util.CDOEvent; import org.eclipse.emf.cdo.view.CDOView; import org.eclipse.net4j.util.options.IOptionsEvent; @@ -130,14 +129,14 @@ public interface CDOTransaction extends CDOView, CDOUserTransaction /** * @author Eike Stepper */ - public interface ConflictResolversEvent extends IOptionsEvent, CDOEvent + public interface ConflictResolversEvent extends IOptionsEvent { } /** * @author Eike Stepper */ - public interface AutoReleaseLockEvent extends IOptionsEvent, CDOEvent + public interface AutoReleaseLockEvent extends IOptionsEvent { } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOEvent.java deleted file mode 100644 index 9fe1b36fa8..0000000000 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Eike Stepper - initial API and implementation - */ -package org.eclipse.emf.cdo.util; - -import org.eclipse.emf.cdo.session.CDOSession; -import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.view.CDOView; - -import org.eclipse.net4j.util.event.IEvent; - -/** - * A marker interface for all {@link IEvent events} sent by CDO client facilities, like {@link CDOSession sessions}, - * {@link CDOView views}, {@link CDOTransaction transactions} and others. - * - * @author Eike Stepper - * @noimplement This interface is not intended to be implemented by clients. - * @since 2.0 - */ -public interface CDOEvent extends IEvent -{ -} 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 2186b6f47d..ec47767936 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 @@ -23,7 +23,6 @@ import org.eclipse.emf.cdo.eresource.CDOResourceFolder; import org.eclipse.emf.cdo.eresource.CDOResourceNode; import org.eclipse.emf.cdo.session.CDOSession; import org.eclipse.emf.cdo.transaction.CDOTransaction; -import org.eclipse.emf.cdo.util.CDOEvent; import org.eclipse.emf.cdo.util.ReadOnlyException; import org.eclipse.net4j.util.collection.CloseableIterator; @@ -418,23 +417,23 @@ public interface CDOView extends CDOCommonView, INotifier, IOptionsContainer */ public void setRevisionPrefetchingPolicy(CDORevisionPrefetchingPolicy prefetchingPolicy); - public interface CacheReferenceTypeEvent extends IOptionsEvent, CDOEvent + public interface CacheReferenceTypeEvent extends IOptionsEvent { } - public interface ReferencePolicyEvent extends IOptionsEvent, CDOEvent + public interface ReferencePolicyEvent extends IOptionsEvent { } - public interface ChangeSubscriptionPoliciesEvent extends IOptionsEvent, CDOEvent + public interface ChangeSubscriptionPoliciesEvent extends IOptionsEvent { } - public interface InvalidationNotificationEvent extends IOptionsEvent, CDOEvent + public interface InvalidationNotificationEvent extends IOptionsEvent { } - public interface RevisionPrefetchingPolicyEvent extends IOptionsEvent, CDOEvent + public interface RevisionPrefetchingPolicyEvent extends IOptionsEvent { } } diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewEvent.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewEvent.java index 1ef45f6f5e..2a523b9614 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewEvent.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOViewEvent.java @@ -10,14 +10,14 @@ */ package org.eclipse.emf.cdo.view; -import org.eclipse.emf.cdo.util.CDOEvent; +import org.eclipse.net4j.util.event.IEvent; /** * @author Eike Stepper * @noimplement This interface is not intended to be implemented by clients. * @since 2.0 */ -public interface CDOViewEvent extends CDOEvent +public interface CDOViewEvent extends IEvent { /** * @since 3.0 |