X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=bundles%2Forg.simantics.db%2Fsrc%2Forg%2Fsimantics%2Fdb%2Frequest%2FWriteOnlyResult.java;h=502c84d18ee93d5d775e3bd5ced4b7d678e81095;hb=d33a5a61e2c056a3d48733819257890406ee9d52;hp=ceb10d7036d5038c8a546762c64b23bdcf50163f;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git
diff --git a/bundles/org.simantics.db/src/org/simantics/db/request/WriteOnlyResult.java b/bundles/org.simantics.db/src/org/simantics/db/request/WriteOnlyResult.java
index ceb10d703..502c84d18 100644
--- a/bundles/org.simantics.db/src/org/simantics/db/request/WriteOnlyResult.java
+++ b/bundles/org.simantics.db/src/org/simantics/db/request/WriteOnlyResult.java
@@ -1,95 +1,96 @@
-/*******************************************************************************
- * 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.db.request;
-
-import org.simantics.db.Session;
-import org.simantics.db.WriteOnlyGraph;
-import org.simantics.db.exception.CancelTransactionException;
-import org.simantics.db.exception.DatabaseException;
-
-/**
- * The GraphRequest
interface is used to create transaction
- * requests to Simantics database implementations. Both read and write
- * transaction requests use the same interface.
- *
- *
- * The actual work carried out by the implemented request should be done in the
- * perform
method. It receives a WriteOnlyGraph
instance as
- * the only argument which is the interface for actually reading and writing the
- * graph data model.
- *
- *
- * Transaction requests can be made to the database by creating your own
- * GraphRequest
instance and putting it in the request queue of
- * the database session through the {@link Session} interface. The database
- * session is responsible for executing the queued requests in a thread of its
- * choice, or possibly/preferably multiple threads. The database session can
- * allow multiple read-only requests to occur simultaneously, but read-write
- * requests require exclusive database access. In other words only one
- * read-write request can be in execution simultaneously.
- *
- *
- * This interface also has two callbacks - handleException
for
- * allowing handling any exceptions thrown by perform
and
- * requestCompleted
for performing actions after a request has
- * been successfully completed.
- *
- *
- * Clients of this interface are encouraged to extend the provided abstract - * implementations or this class or extend their own helper implementations for - * ones particular needs. The provided abstract implementations are: - *
GraphRequest
is serviced by the database session
- * the method perform
is invoked.
- *
- *
- * Perform receives an object instance implementing the WriteOnlyGraph
- * interface which provides the only way to read/write the graph data model.
- * The Graph instance must only be valid during the execution of the
- * perform
method and therefore should not be stored for use
- * outside of its execution.
- *
- *
- * The general contract of the method perform
is that it may
- * take any action whatsoever which involves reading or writing the data
- * model through the received Graph instance.
- *
- * @param g an interface for reading and writing the data model
- * @return the result status of the request which affects how the
- * transaction proceeds, see GraphRequestStatus for more information
- * @throws Exception when anything goes wrong inside the request thread
- * @throws CancelTransactionException to indicate that the request needs to
- * be cancelled and any changes rolled back
- */
- T perform(WriteOnlyGraph graph) throws DatabaseException;
-
-}
+/*******************************************************************************
+ * 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.db.request;
+
+import org.simantics.db.Session;
+import org.simantics.db.WriteOnlyGraph;
+import org.simantics.db.exception.CancelTransactionException;
+import org.simantics.db.exception.DatabaseException;
+
+/**
+ * The GraphRequest
interface is used to create transaction
+ * requests to Simantics database implementations. Both read and write
+ * transaction requests use the same interface.
+ *
+ *
+ * The actual work carried out by the implemented request should be done in the
+ * perform
method. It receives a WriteOnlyGraph
instance as
+ * the only argument which is the interface for actually reading and writing the
+ * graph data model.
+ *
+ *
+ * Transaction requests can be made to the database by creating your own
+ * GraphRequest
instance and putting it in the request queue of
+ * the database session through the {@link Session} interface. The database
+ * session is responsible for executing the queued requests in a thread of its
+ * choice, or possibly/preferably multiple threads. The database session can
+ * allow multiple read-only requests to occur simultaneously, but read-write
+ * requests require exclusive database access. In other words only one
+ * read-write request can be in execution simultaneously.
+ *
+ *
+ * This interface also has two callbacks - handleException
for
+ * allowing handling any exceptions thrown by perform
and
+ * requestCompleted
for performing actions after a request has
+ * been successfully completed.
+ *
+ *
+ * Clients of this interface are encouraged to extend the provided abstract + * implementations or this class or extend their own helper implementations for + * ones particular needs. The provided abstract implementations are: + *
GraphRequest
is serviced by the database session
+ * the method perform
is invoked.
+ *
+ *
+ * Perform receives an object instance implementing the WriteOnlyGraph
+ * interface which provides the only way to read/write the graph data model.
+ * The Graph instance must only be valid during the execution of the
+ * perform
method and therefore should not be stored for use
+ * outside of its execution.
+ *
+ *
+ * The general contract of the method perform
is that it may
+ * take any action whatsoever which involves reading or writing the data
+ * model through the received Graph instance.
+ *
+ * @param g an interface for reading and writing the data model
+ * @return the result status of the request which affects how the
+ * transaction proceeds, see GraphRequestStatus for more information
+ * @throws Exception when anything goes wrong inside the request thread
+ * @throws CancelTransactionException to indicate that the request needs to
+ * be cancelled and any changes rolled back
+ */
+ T perform(WriteOnlyGraph graph) throws DatabaseException;
+
+}