Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-10-22 12:43:00 -0400
committerslewis2008-10-22 12:43:00 -0400
commit57956f4fcaf369e2308b58ad7dd459dcfd5f0f9b (patch)
treecfb47a34e19a3ceb6bb740d5fe8f93fbf3979198 /framework/bundles/org.eclipse.ecf.sync
parent5acd85345a09611cabfeef6ca82f8c4c5b94f389 (diff)
downloadorg.eclipse.ecf-57956f4fcaf369e2308b58ad7dd459dcfd5f0f9b.tar.gz
org.eclipse.ecf-57956f4fcaf369e2308b58ad7dd459dcfd5f0f9b.tar.xz
org.eclipse.ecf-57956f4fcaf369e2308b58ad7dd459dcfd5f0f9b.zip
Updated with fixes from https://bugs.eclipse.org/bugs/show_bug.cgi?id=234142#c10
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.java14
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java11
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java8
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java14
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IServiceConstants.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java12
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java13
9 files changed, 75 insertions, 7 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 16cce7d48..d0fb1313b 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
@@ -1,3 +1,13 @@
+/****************************************************************************
+ * Copyright (c) 2008 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
package org.eclipse.ecf.internal.sync;
import java.util.Dictionary;
@@ -27,8 +37,8 @@ public class Activator implements BundleActivator {
private ServiceRegistration identityServiceRegistration;
private BundleContext context;
- IDocumentSynchronizationStrategyFactory identity;
- IDocumentSynchronizationStrategyFactory cola;
+ IdentitySynchronizationStrategyFactory identity;
+ ColaSynchronizationStrategyFactory cola;
private ServiceTracker adapterManagerTracker = null;
private ServiceTracker logServiceTracker = null;
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java
index 066a2bfbd..400017b41 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java
@@ -1,3 +1,13 @@
+/****************************************************************************
+ * Copyright (c) 2008 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
package org.eclipse.ecf.sync;
import org.eclipse.core.runtime.IAdaptable;
@@ -7,6 +17,7 @@ import org.eclipse.core.runtime.IAdaptable;
* a 'tag' interface and does not define any methods.
* See sub-interfaces that extend this interface.
*
+ * @since 2.1
*/
public interface IModelChange extends IAdaptable {
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java
index 98474a66c..39a2a50b5 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java
@@ -18,9 +18,17 @@ import org.eclipse.core.runtime.IAdaptable;
* Change message. Instances of this interface
* may be serialized to a byte [] so that they can be
* communicated to remote processes.
+ *
+ * @since 2.1
*/
public interface IModelChangeMessage extends IAdaptable {
+ /**
+ * Serialize this message to byte [].
+ * @return byte [] that is serialized representation of this model change message.
+ * @throws SerializationException if this model change message
+ * cannot be serialized.
+ */
public byte[] serialize() throws SerializationException;
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java
index 14cbb0543..0f133a4f6 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java
@@ -1,3 +1,13 @@
+/****************************************************************************
+ * Copyright (c) 2008 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
package org.eclipse.ecf.sync;
import org.eclipse.core.runtime.IAdaptable;
@@ -52,6 +62,8 @@ import org.eclipse.core.runtime.IAdaptable;
* and the changes from {@link #transformRemoteChange(IModelChange)} should also
* be applied to the local document from within this same thread.
* </p>
+ *
+ * @since 2.1
*/
public interface IModelSynchronizationStrategy extends IAdaptable {
@@ -79,7 +91,7 @@ public interface IModelSynchronizationStrategy extends IAdaptable {
* @param remoteChange
* the remote model change instance to be transformed by this
* synchronization strategy.
- * @return IDocumentChange[] to apply to local model
+ * @return IModelChange[] to apply to local model.
*/
public IModelChange[] transformRemoteChange(IModelChange remoteChange);
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IServiceConstants.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IServiceConstants.java
index f71468a6c..3b99c6298 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IServiceConstants.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IServiceConstants.java
@@ -12,7 +12,9 @@
package org.eclipse.ecf.sync;
/**
- *
+ * Constants for ISynchronizationStrategy services.
+ *
+ * @since 2.1
*/
public interface IServiceConstants {
public static final String SYNCSTRATEGY_TYPE_PROPERTY = "org.eclipse.ecf.type";
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java
index 5023649c6..9ad43bc36 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java
@@ -17,7 +17,9 @@ import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.internal.sync.Activator;
/**
- *
+ * Exception for serialization problems.
+ *
+ * @since 2.1
*/
public class SerializationException extends ECFException {
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 26eaaf7eb..26b3c754f 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
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2007, 2008 Composent, Inc. and others.
+ * Copyright (c) 2008 Composent, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,7 +25,10 @@ import org.eclipse.ecf.sync.IModelChangeMessage;
import org.eclipse.ecf.sync.SerializationException;
/**
+ * Document change message of communicating document change
+ * events to remote models.
*
+ * @since 2.1
*/
public class DocumentChangeMessage implements IDocumentChange, IModelChangeMessage, Serializable {
@@ -45,6 +48,13 @@ public class DocumentChangeMessage implements IDocumentChange, IModelChangeMessa
private int offset;
private int length;
+ /**
+ * Create document change message for given offset, length of replacement, and text to replace.
+ *
+ * @param offset the offset (number of characters) in the document where change is to occur.
+ * @param length the length (number of characters) that are to be replace in existing document.
+ * @param text the text to actually replace.
+ */
public DocumentChangeMessage(int offset, int length, String text) {
this.offset = offset;
this.length = length;
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
index 2520feaef..874d8da4f 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
@@ -16,6 +16,8 @@ import org.eclipse.ecf.sync.IModelChange;
/**
* Local document change. Instances of this class represent
* local changes to a replicated document.
+ *
+ * @since 2.1
*/
public interface IDocumentChange extends IModelChange {
/**
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 2d3770bd1..e6fbad662 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
@@ -9,6 +9,16 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
+/****************************************************************************
+ * Copyright (c) 2008 Composent, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Composent, Inc. - initial API and implementation
+ *****************************************************************************/
package org.eclipse.ecf.sync.doc;
import org.eclipse.ecf.core.identity.ID;
@@ -18,6 +28,8 @@ import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
* Factory for creating {@link IModelSynchronizationStrategy} instances for
* a uniquely identified entity. This interface is exposed as a service and
* provides an entry point for clients.
+ *
+ * @since 2.1
*/
public interface IDocumentSynchronizationStrategyFactory {
@@ -38,5 +50,4 @@ public interface IDocumentSynchronizationStrategyFactory {
*/
public void disposeSynchronizationStrategy(ID uniqueID);
- public void dispose();
}

Back to the top