]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/IExperiment.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.simulation / src / org / simantics / simulation / experiment / IExperiment.java
diff --git a/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/IExperiment.java b/bundles/org.simantics.simulation/src/org/simantics/simulation/experiment/IExperiment.java
new file mode 100644 (file)
index 0000000..a846b09
--- /dev/null
@@ -0,0 +1,76 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.simulation.experiment;\r
+\r
+import java.util.concurrent.locks.Lock;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.simantics.databoard.accessor.Accessor;\r
+import org.simantics.db.ReadGraph;\r
+import org.simantics.db.RequestProcessor;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.Session;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+public interface IExperiment {\r
+\r
+       <T> T getService(Class<T> clazz);\r
+       \r
+    String getIdentifier();\r
+\r
+    ExperimentState getState();\r
+    ExperimentState getState(ReadGraph graph) throws DatabaseException;\r
+    void changeState(ExperimentState state);\r
+\r
+    Resource getResource();\r
+    Resource getModel();\r
+\r
+    /**\r
+     * @param monitor\r
+     *            the progress monitor to use for reporting progress to the user\r
+     *            during the operation. It is the caller's responsibility to\r
+     *            call done() on the given monitor. Accepts null, indicating\r
+     *            that no progress should be reported and that the operation\r
+     *            cannot be cancelled.\r
+     */\r
+    void shutdown(IProgressMonitor monitor);\r
+\r
+    void addListener(IExperimentListener listener);\r
+    void removeListener(IExperimentListener listener);\r
+\r
+    void addStatusListener(IExperimentStatusListener listener);\r
+    void removeStatusListener(IExperimentStatusListener listener);\r
+\r
+    //Historian getDataSession();\r
+    \r
+    /**\r
+     * Get the lock object to the datasource. Lock must be acquired\r
+     * for write operations.  \r
+     */\r
+    Lock getDatasourceLock();\r
+    \r
+    /**\r
+     * Get an accessor to the experiment.\r
+     * The returned accessor follows Datasource Contract.\r
+     * https://www.simantics.org/wiki/index.php/Databoard_Specification#Datasource_Contract\r
+     * \r
+     * @return valuation accessor\r
+     */\r
+    Accessor getAccessor();\r
+\r
+    /**\r
+     * Synchronizes the running experiment with configuration.\r
+     */\r
+    public void refresh(Session session);\r
+    public void refresh(RequestProcessor session);\r
+    \r
+}\r