X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fsynchronization%2FIModificationQueue.java;h=1369c61f4f348d18b0814b92c02dc6707a3cdfcf;hb=refs%2Fchanges%2F38%2F238%2F2;hp=e43cd896d57ab24f37267610ae4638f438a144df;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IModificationQueue.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IModificationQueue.java index e43cd896d..1369c61f4 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IModificationQueue.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/IModificationQueue.java @@ -1,73 +1,73 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.diagram.synchronization; - -import org.simantics.utils.threads.IThreadWorkQueue; - -/** - * An abstraction for a queue of modifications to be performed into a backend - * model for synchronization with the diagram model. - * - * @author Tuukka Lehtonen - */ -public interface IModificationQueue { - - /** - * Asynchronously perform the specified modification, using the specified - * thread for the modification completion event. This method will not - * cause any write request invocations to the backend, it merely offers the - * modifications up for execution. After several modifications have been - * offered, {@link #flush()} may be invoked to execute the offered - * modifications to execute multiple modifications in one transaction. - * - *

- * This method should be equal to calling - * {@link #offer(IModification, IThreadWorkQueue)} with a null - * IThreadWorkQueue argument. - * - * @param m the modification to execute - * @return true if the modification was added to the queue - */ - boolean offer(IModification m); - - /** - * Asynchronously perform the specified modification, using the specified - * thread for the modification completion event. This method will not - * cause any write request invocations to the backend, it merely offers the - * modifications up for execution. After several modifications have been - * offered, {@link #flush()} may be invoked to execute the offered - * modifications to execute multiple modifications in one transaction. - * - * @param m the modification to execute - * @param completionThread the thread to be used for running the - * modification completion event or null to not care - * about the thread. - * @return true if the modification was added to the queue - */ - boolean offer(IModification m, IThreadWorkQueue completionThread); - - /** - * Flushes the queue of modifications. All modifications shall be dispatched - * to be executed but this method can return at any time before the - * modifications have been performed. - */ - void flush(); - - /** - * Finishes the queue of modifications gathered so far. This method will - * block until all current modifications have been ran to completion. - * - * @throws InterruptedException if the waiting thread is interrupted - */ - void finish() throws InterruptedException; - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.diagram.synchronization; + +import org.simantics.utils.threads.IThreadWorkQueue; + +/** + * An abstraction for a queue of modifications to be performed into a backend + * model for synchronization with the diagram model. + * + * @author Tuukka Lehtonen + */ +public interface IModificationQueue { + + /** + * Asynchronously perform the specified modification, using the specified + * thread for the modification completion event. This method will not + * cause any write request invocations to the backend, it merely offers the + * modifications up for execution. After several modifications have been + * offered, {@link #flush()} may be invoked to execute the offered + * modifications to execute multiple modifications in one transaction. + * + *

+ * This method should be equal to calling + * {@link #offer(IModification, IThreadWorkQueue)} with a null + * IThreadWorkQueue argument. + * + * @param m the modification to execute + * @return true if the modification was added to the queue + */ + boolean offer(IModification m); + + /** + * Asynchronously perform the specified modification, using the specified + * thread for the modification completion event. This method will not + * cause any write request invocations to the backend, it merely offers the + * modifications up for execution. After several modifications have been + * offered, {@link #flush()} may be invoked to execute the offered + * modifications to execute multiple modifications in one transaction. + * + * @param m the modification to execute + * @param completionThread the thread to be used for running the + * modification completion event or null to not care + * about the thread. + * @return true if the modification was added to the queue + */ + boolean offer(IModification m, IThreadWorkQueue completionThread); + + /** + * Flushes the queue of modifications. All modifications shall be dispatched + * to be executed but this method can return at any time before the + * modifications have been performed. + */ + void flush(); + + /** + * Finishes the queue of modifications gathered so far. This method will + * block until all current modifications have been ran to completion. + * + * @throws InterruptedException if the waiting thread is interrupted + */ + void finish() throws InterruptedException; + +}