Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-15 18:40:10 +0000
committerEike Stepper2012-09-15 18:40:10 +0000
commitb1a4178ca7c5d3087e329f3b8fe6c41eb8f55d42 (patch)
tree3bba9367a8829740fad4546b451000ee4412004f /plugins/org.eclipse.emf.cdo.transfer.repository
parent661d7d2e8bb433cfa71ce43e2a8c63e383930ca7 (diff)
downloadcdo-b1a4178ca7c5d3087e329f3b8fe6c41eb8f55d42.tar.gz
cdo-b1a4178ca7c5d3087e329f3b8fe6c41eb8f55d42.tar.xz
cdo-b1a4178ca7c5d3087e329f3b8fe6c41eb8f55d42.zip
[388928] Develop a resource transfer framework
https://bugs.eclipse.org/bugs/show_bug.cgi?id=388928
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.transfer.repository')
-rw-r--r--plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java78
1 files changed, 2 insertions, 76 deletions
diff --git a/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java b/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
index f389be5597..41568a491d 100644
--- a/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
+++ b/plugins/org.eclipse.emf.cdo.transfer.repository/src/org/eclipse/emf/cdo/transfer/spi/repository/RepositoryTransferSystem.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.transfer.spi.repository;
-import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.lob.CDOBlob;
import org.eclipse.emf.cdo.common.lob.CDOClob;
@@ -26,15 +25,9 @@ import org.eclipse.emf.cdo.transfer.CDOTransferSystem;
import org.eclipse.emf.cdo.transfer.CDOTransferType;
import org.eclipse.emf.cdo.util.CDOURIUtil;
import org.eclipse.emf.cdo.view.CDOView;
-import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
-import org.eclipse.net4j.util.event.IEvent;
-import org.eclipse.net4j.util.event.IListener;
import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IOUtil;
-import org.eclipse.net4j.util.lifecycle.ILifecycle;
-import org.eclipse.net4j.util.lifecycle.LifecycleEventAdapter;
-import org.eclipse.net4j.util.ref.ReferenceValueMap;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -50,9 +43,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
/**
* @author Eike Stepper
@@ -62,15 +52,9 @@ public class RepositoryTransferSystem extends CDOTransferSystem
{
public static final String TYPE = "repository";
- private static final Map<CDOView, RepositoryTransferSystem> INSTANCES = new WeakHashMap<CDOView, RepositoryTransferSystem>();
-
- private static final IListener VIEW_LISTENER = new ViewListener();
-
private final CDOView view;
- private final Map<IPath, CDOResourceNode> resourceNodeCache = new ReferenceValueMap.Soft<IPath, CDOResourceNode>();
-
- private RepositoryTransferSystem(CDOView view)
+ public RepositoryTransferSystem(CDOView view)
{
super(view.isReadOnly());
this.view = view;
@@ -94,7 +78,7 @@ public class RepositoryTransferSystem extends CDOTransferSystem
CDOBranch branch = view.getBranch();
CDOSession session = view.getSession();
CDOTransaction transaction = session.openTransaction(branch);
- return getInstance(transaction);
+ return new RepositoryTransferSystem(transaction);
}
return this;
@@ -141,7 +125,6 @@ public class RepositoryTransferSystem extends CDOTransferSystem
@Override
public CDOTransferElement getElement(IPath path)
{
- System.out.println("Get element for: " + path);
if (path.isEmpty())
{
return new RootElement(this, view.getRootResource());
@@ -217,63 +200,6 @@ public class RepositoryTransferSystem extends CDOTransferSystem
return "Repository " + view.getSession().getRepositoryInfo().getName();
}
- protected void handleViewInvalidation(CDOViewInvalidationEvent event)
- {
- Set<CDOObject> dirtyObjects = event.getDirtyObjects();
- }
-
- public static RepositoryTransferSystem getInstance(CDOView view)
- {
- synchronized (INSTANCES)
- {
- RepositoryTransferSystem instance = INSTANCES.get(view);
- if (instance == null)
- {
- instance = new RepositoryTransferSystem(view);
- view.addListener(VIEW_LISTENER);
- INSTANCES.put(view, instance);
- }
-
- return instance;
- }
- }
-
- /**
- * @author Eike Stepper
- */
- private static class ViewListener extends LifecycleEventAdapter
- {
- @Override
- protected void onDeactivated(ILifecycle view)
- {
- synchronized (INSTANCES)
- {
- INSTANCES.remove(view);
- }
- }
-
- @Override
- protected void notifyOtherEvent(IEvent event)
- {
- if (event instanceof CDOViewInvalidationEvent)
- {
- CDOViewInvalidationEvent e = (CDOViewInvalidationEvent)event;
- CDOView view = e.getSource();
-
- RepositoryTransferSystem instance;
- synchronized (INSTANCES)
- {
- instance = INSTANCES.get(view);
- }
-
- if (instance != null)
- {
- instance.handleViewInvalidation(e);
- }
- }
- }
- }
-
/**
* @author Eike Stepper
*/

Back to the top