Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-10-23 14:45:33 +0000
committerEike Stepper2010-10-23 14:45:33 +0000
commit8e02069af25dfb99bffec3eca5f75b44c15588a1 (patch)
treee3e72c2a9e961aaf14fe577434b438f594452afc /plugins/org.eclipse.emf.cdo.workspace
parentb17e18c5fbe00acf61ee191693d0b586f0e230ec (diff)
downloadcdo-8e02069af25dfb99bffec3eca5f75b44c15588a1.tar.gz
cdo-8e02069af25dfb99bffec3eca5f75b44c15588a1.tar.xz
cdo-8e02069af25dfb99bffec3eca5f75b44c15588a1.zip
[327405] Provide an offline CDOWorkspace with Checkout/Update/Commit workflows
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327405
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.workspace')
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
index aa23846df0..5af9d1a1c7 100644
--- a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
+++ b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.commit.CDOChangeSet;
import org.eclipse.emf.cdo.common.commit.CDOChangeSetData;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionCache;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
@@ -165,16 +166,9 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
localRepository.setRootResourceID(session.getRepositoryInfo().getRootResourceID());
InternalCDOPackageUnit[] packageUnits = session.getPackageRegistry().getPackageUnits(false);
+ registerPackageUnits(packageUnits);
context[0] = accessor.rawStore(packageUnits, context[0], monitor);
- InternalCDOPackageRegistry repositoryPackageRegistry = localRepository.getPackageRegistry(false);
- InternalCDOPackageRegistry sessionPackageRegistry = getLocalSession().getPackageRegistry();
- for (InternalCDOPackageUnit packageUnit : packageUnits)
- {
- repositoryPackageRegistry.putPackageUnit(packageUnit);
- sessionPackageRegistry.putPackageUnit(packageUnit);
- }
-
CDORevisionHandler handler = new CDORevisionHandler()
{
public boolean handleRevision(CDORevision revision)
@@ -209,6 +203,16 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
}
}
+ private void registerPackageUnits(InternalCDOPackageUnit[] packageUnits)
+ {
+ InternalCDOPackageRegistry repositoryPackageRegistry = localRepository.getPackageRegistry(false);
+ for (InternalCDOPackageUnit packageUnit : packageUnits)
+ {
+ packageUnit.setState(CDOPackageUnit.State.LOADED);
+ repositoryPackageRegistry.putPackageUnit(packageUnit);
+ }
+ }
+
protected void open()
{
}
@@ -501,7 +505,10 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
configuration.setConnector(connector);
configuration.setRepositoryName(repositoryName);
configuration.setRevisionManager(CDORevisionUtil.createRevisionManager(CDORevisionCache.NOOP)); // Use repo's cache
- return (InternalCDOSession)configuration.openSession();
+
+ InternalCDOSession session = (InternalCDOSession)configuration.openSession();
+ session.setPackageRegistry(localRepository.getPackageRegistry(false)); // Use repo's registry
+ return session;
}
protected InternalCDOView[] getViews()

Back to the top