Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-10-14 03:25:57 +0000
committerslewis2008-10-14 03:25:57 +0000
commita3d9bf216ee07a7386cdffb4d140eaffaf700eff (patch)
tree683b1c86d98396e58d83029b660f44fb9b1c7ecf /framework
parent0b43eaa4df0caff688734c2cd136485fa2206be7 (diff)
downloadorg.eclipse.ecf-a3d9bf216ee07a7386cdffb4d140eaffaf700eff.tar.gz
org.eclipse.ecf-a3d9bf216ee07a7386cdffb4d140eaffaf700eff.tar.xz
org.eclipse.ecf-a3d9bf216ee07a7386cdffb4d140eaffaf700eff.zip
Added dispose to IDocumentSynchronizationStrategyFactory
Diffstat (limited to 'framework')
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java17
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java3
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java2
5 files changed, 29 insertions, 3 deletions
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java
index 3f74dee68..a6934b726 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java
@@ -20,6 +20,9 @@ public class Activator implements BundleActivator {
private ServiceRegistration identityServiceRegistration;
private BundleContext context;
+ IDocumentSynchronizationStrategyFactory identity;
+ IDocumentSynchronizationStrategyFactory cola;
+
public static Activator getDefault() {
return bundle;
}
@@ -31,16 +34,18 @@ public class Activator implements BundleActivator {
public void start(BundleContext ctxt) throws Exception {
bundle = this;
this.context = ctxt;
+ this.identity = new IdentitySynchronizationStrategyFactory();
+ this.cola = new ColaSynchronizationStrategyFactory();
// Register identity synchronizer service
final Dictionary identityServiceProps = new Properties();
identityServiceProps.put(IServiceConstants.SYNCSTRATEGY_TYPE_PROPERTY, IdentitySynchronizationStrategyFactory.SYNCHSTRATEGY_TYPE);
identityServiceProps.put(IServiceConstants.SYNCSTRATEGY_PROVIDER_PROPETY, IdentitySynchronizationStrategyFactory.SYNCHSTRATEGY_PROVIDER);
- identityServiceRegistration = this.context.registerService(IDocumentSynchronizationStrategyFactory.class.getName(), new IdentitySynchronizationStrategyFactory(), identityServiceProps);
+ identityServiceRegistration = this.context.registerService(IDocumentSynchronizationStrategyFactory.class.getName(), this.identity, identityServiceProps);
// Register cola synchronizer service
final Dictionary colaServiceProps = new Properties();
colaServiceProps.put(IServiceConstants.SYNCSTRATEGY_TYPE_PROPERTY, ColaSynchronizationStrategyFactory.SYNCHSTRATEGY_TYPE);
colaServiceProps.put(IServiceConstants.SYNCSTRATEGY_PROVIDER_PROPETY, ColaSynchronizationStrategyFactory.SYNCHSTRATEGY_PROVIDER);
- colaServiceRegistration = this.context.registerService(IDocumentSynchronizationStrategyFactory.class.getName(), new ColaSynchronizationStrategyFactory(), colaServiceProps);
+ colaServiceRegistration = this.context.registerService(IDocumentSynchronizationStrategyFactory.class.getName(), this.cola, colaServiceProps);
}
/*
@@ -56,6 +61,14 @@ public class Activator implements BundleActivator {
identityServiceRegistration.unregister();
identityServiceRegistration = null;
}
+ if (this.identity != null) {
+ this.identity.dispose();
+ this.identity = null;
+ }
+ if (this.cola != null) {
+ this.cola.dispose();
+ this.cola = null;
+ }
this.context = null;
bundle = null;
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
index 822532982..05cd95a39 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
@@ -39,7 +39,7 @@ public class ColaSynchronizationStrategy implements IModelSynchronizationStrateg
private long localOperationsCount;
private long remoteOperationsCount;
- // <DocShare, ColaSynchronizationStrategy>
+ // <ID, ColaSynchronizationStrategy>
private static Map sessionStrategies = new HashMap();
private ColaSynchronizationStrategy(boolean isInitiator) {
@@ -60,6 +60,10 @@ public class ColaSynchronizationStrategy implements IModelSynchronizationStrateg
sessionStrategies.remove(client);
}
+ public static void dispose() {
+ sessionStrategies.clear();
+ }
+
public DocumentChangeMessage registerOutgoingMessage(DocumentChangeMessage localMsg) {
Trace.entering(Activator.PLUGIN_ID, SyncDebugOptions.METHODS_ENTERING, this.getClass(), "registerOutgoingMessage", localMsg); //$NON-NLS-1$
final ColaDocumentChangeMessage colaMsg = new ColaDocumentChangeMessage(localMsg, localOperationsCount, remoteOperationsCount);
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
index 54dc553a9..1a2ade662 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
@@ -36,4 +36,8 @@ public class ColaSynchronizationStrategyFactory implements IDocumentSynchronizat
return ColaSynchronizationStrategy.getInstanceFor(uniqueID, isInitiator);
}
+ public void dispose() {
+ ColaSynchronizationStrategy.dispose();
+ }
+
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
index 77576f6d6..fcd314c31 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
@@ -35,4 +35,7 @@ public class IdentitySynchronizationStrategyFactory implements IDocumentSynchron
return new IdentitySynchronizationStrategy();
}
+ public void dispose() {
+
+ }
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
index ca68a7e33..2d3770bd1 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
@@ -37,4 +37,6 @@ public interface IDocumentSynchronizationStrategyFactory {
* @param uniqueID the ID of the
*/
public void disposeSynchronizationStrategy(ID uniqueID);
+
+ public void dispose();
}

Back to the top