diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOLockStateLoadingPolicy.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOLockStateLoadingPolicy.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOLockStateLoadingPolicy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOLockStateLoadingPolicy.java new file mode 100644 index 0000000000..7d95e7602f --- /dev/null +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOLockStateLoadingPolicy.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2004-2014 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: + * Esteban Dugueperoux - initial API and implementation + */ +package org.eclipse.emf.cdo.view; + +import org.eclipse.emf.cdo.common.id.CDOID; +import org.eclipse.emf.cdo.common.lock.CDOLockState; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.eresource.CDOResource; +import org.eclipse.emf.cdo.view.CDOView.Options; + +import org.eclipse.emf.ecore.resource.ResourceSet; + +/** + * An interface to control if {@link CDOLockState lock states} are loaded when {@link CDORevision revisions} are loaded to limit requests sent to server. This interface is to be used when {@link Options#setLockStatePrefetchEnabled(boolean) lock state prefetch view option} is enabled. + * <br/> + * <br/> + * Note that lock states will not be loaded automatically for {@link CDOResource} when being created through {@link ResourceSet#getResource(org.eclipse.emf.common.util.URI, boolean)}, {@link CDOResource#cdoLockState()} must be called explicitly to load it. + * @see Options#setLockStatePrefetchEnabled(boolean) + * @author Esteban Dugueperoux + * @since 4.4 + */ +public interface CDOLockStateLoadingPolicy +{ + /** + * Tell if the {@link CDOLockState lock state} must be loaded for the current {@link CDOView view} when the {@link CDORevision revision} corresponding to the specified {@link CDOID id} is loaded. + * + * @param id the of the loaded revision + * @return true to have lock state loaded for the specified revision's id for the current view + */ + boolean loadLockState(CDOID id); +} |