Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-12-22 13:09:49 +0000
committerEike Stepper2010-12-22 13:09:49 +0000
commita828d91030c77caa63f7ba878f529eaafb274fb6 (patch)
tree782049eddd8082d276064e1b91b5f47cb2e6372b
parentf5f969ce0b4c158aee51b24db45ef84723faffa5 (diff)
downloadcdo-a828d91030c77caa63f7ba878f529eaafb274fb6.tar.gz
cdo-a828d91030c77caa63f7ba878f529eaafb274fb6.tar.xz
cdo-a828d91030c77caa63f7ba878f529eaafb274fb6.zip
[327405] Provide an offline CDOWorkspace with Checkout/Update/Commit workflows
https://bugs.eclipse.org/bugs/show_bug.cgi?id=327405
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace.efs/src/org/eclipse/emf/cdo/workspace/internal/efs/CDOWorkspaceStore.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java16
2 files changed, 15 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.workspace.efs/src/org/eclipse/emf/cdo/workspace/internal/efs/CDOWorkspaceStore.java b/plugins/org.eclipse.emf.cdo.workspace.efs/src/org/eclipse/emf/cdo/workspace/internal/efs/CDOWorkspaceStore.java
index 952e7c619d..bbe7779ba8 100644
--- a/plugins/org.eclipse.emf.cdo.workspace.efs/src/org/eclipse/emf/cdo/workspace/internal/efs/CDOWorkspaceStore.java
+++ b/plugins/org.eclipse.emf.cdo.workspace.efs/src/org/eclipse/emf/cdo/workspace/internal/efs/CDOWorkspaceStore.java
@@ -289,7 +289,10 @@ public final class CDOWorkspaceStore extends AbstractResourceNodeStore
int index = cdoContents.indexOf(cdoObject);
if (index != -1)
{
- cdoContents.move(i, index);
+ if (index != i)
+ {
+ cdoContents.move(i, index);
+ }
}
else
{
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 2254a350e8..0140a57e32 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
@@ -27,6 +27,7 @@ import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDeltaUtil;
import org.eclipse.emf.cdo.internal.server.Repository;
import org.eclipse.emf.cdo.net4j.CDONet4jUtil;
+import org.eclipse.emf.cdo.server.CDOServerBrowser;
import org.eclipse.emf.cdo.server.CDOServerUtil;
import org.eclipse.emf.cdo.server.IRepository.Props;
import org.eclipse.emf.cdo.server.IStore;
@@ -115,6 +116,8 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
private Set<InternalCDOView> views = new HashSet<InternalCDOView>();
+ private CDOServerBrowser browser;
+
public CDOWorkspaceImpl(IStore local, InternalCDOWorkspaceBase base, CDOSessionConfigurationFactory remote,
String branchPath, long timeStamp)
{
@@ -142,11 +145,11 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
localRepository = createLocalRepository(local);
- // Map<String, InternalRepository> repositories = new HashMap<String, InternalRepository>();
- // repositories.put(localRepository.getName(), localRepository);
- // CDOServerBrowser browser = new CDOServerBrowser(repositories);
- // browser.setPort(7778);
- // browser.activate();
+ Map<String, InternalRepository> repositories = new HashMap<String, InternalRepository>();
+ repositories.put(localRepository.getName(), localRepository);
+ browser = new CDOServerBrowser(repositories);
+ browser.setPort(7778);
+ browser.activate();
this.base = base;
this.base.init(this);
@@ -457,6 +460,9 @@ public class CDOWorkspaceImpl implements InternalCDOWorkspace
public synchronized void close()
{
+ LifecycleUtil.deactivate(browser);
+ browser = null;
+
LifecycleUtil.deactivate(localSession);
localSession = null;

Back to the top