Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmayworm2008-10-31 17:40:57 -0400
committermmayworm2008-10-31 17:40:57 -0400
commitc0a74debc6133a768fc80911ea4a9a70cf82d34d (patch)
tree7273f2d2fdb069b890099b2bb79bde0fc2043c59 /framework/bundles/org.eclipse.ecf.sync
parent4db57c28d9326dd4ab47fedb0450ce559fe51bd3 (diff)
downloadorg.eclipse.ecf-c0a74debc6133a768fc80911ea4a9a70cf82d34d.tar.gz
org.eclipse.ecf-c0a74debc6133a768fc80911ea4a9a70cf82d34d.tar.xz
org.eclipse.ecf-c0a74debc6133a768fc80911ea4a9a70cf82d34d.zip
Putting Cola Synch Strategy as the default service
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.sync')
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/Activator.java3
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java10
2 files changed, 13 insertions, 0 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 d0fb1313b..2a16f7f48 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
@@ -24,6 +24,7 @@ import org.eclipse.ecf.sync.IServiceConstants;
import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategyFactory;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.log.LogService;
import org.osgi.util.tracker.ServiceTracker;
@@ -94,6 +95,8 @@ public class Activator implements BundleActivator {
identityServiceRegistration = this.context.registerService(IDocumentSynchronizationStrategyFactory.class.getName(), this.identity, identityServiceProps);
// Register cola synchronizer service
final Dictionary colaServiceProps = new Properties();
+ //OSGi container will return the service with the highest ranking, so by default the Cola SynchStrategie is returned
+ colaServiceProps.put(Constants.SERVICE_RANKING, new Integer(1));
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(), this.cola, colaServiceProps);
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java
index 26b3c754f..8f66142ca 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java
@@ -88,10 +88,17 @@ public class DocumentChangeMessage implements IDocumentChange, IModelChangeMessa
this.length = length;
}
+ /**
+ * @return text
+ */
public String getText() {
return text;
}
+ /**
+ *
+ * @return the length of the inserted text
+ */
public int getLengthOfInsertedText() {
return this.text.length();
}
@@ -110,6 +117,9 @@ public class DocumentChangeMessage implements IDocumentChange, IModelChangeMessa
return bos.toByteArray();
}
+ /**
+ * Serialize the current message
+ */
public byte[] serialize() throws SerializationException {
try {
return serializeLocal();

Back to the top