Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / io / WritableStorageFactory.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/io/WritableStorageFactory.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/io/WritableStorageFactory.java
new file mode 100644 (file)
index 0000000..cf766e2
--- /dev/null
@@ -0,0 +1,69 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.io.WritableStorageFactory\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to You under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.io;\r
+\r
+import java.io.OutputStream;\r
+import java.io.IOException;\r
+import java.io.SyncFailedException;\r
+\r
+/**\r
+ * This interface extends StorageFactory to provide read/write access to storage.\r
+ *<p>\r
+ * The database engine will call this interface's methods from its own privilege blocks.\r
+ *<p>\r
+ * Each WritableStorageFactory instance may be concurrently used by multiple threads.\r
+ *\r
+ */\r
+public interface WritableStorageFactory extends StorageFactory\r
+{\r
+\r
+\r
+    /**\r
+     * Force the data of an output stream out to the underlying storage. That is, ensure that\r
+     * it has been made persistent. If the database is to be transient, that is, if the database\r
+     * does not survive a restart, then the sync method implementation need not do anything.\r
+     *\r
+     * @param stream The stream to be synchronized.\r
+     * @param metaData If true then this method must force both changes to the file's\r
+     *          contents and metadata to be written to storage; if false, it need only force file content changes\r
+     *          to be written. The implementation is allowed to ignore this parameter and always force out\r
+     *          metadata changes.\r
+     *\r
+     * @exception IOException if an I/O error occurs.\r
+     * @exception SyncFailedException Thrown when the buffers cannot be flushed,\r
+     *            or because the system cannot guarantee that all the buffers have been\r
+     *            synchronized with physical media.\r
+     */\r
+    public void sync( OutputStream stream, boolean metaData) throws IOException, SyncFailedException;\r
+\r
+    /**\r
+     * This method tests whether the StorageRandomAccessFile "rws" and "rwd" modes\r
+     * are implemented. If the "rws" and "rwd" modes are supported then the database\r
+     * engine will conclude that the write methods of "rws"/"rwd" mode\r
+     * StorageRandomAccessFiles are slow but the sync method is fast and optimize\r
+     * accordingly.\r
+     *\r
+     * @return <b>true</b> if an StIRandomAccess file opened with "rws" or "rwd" modes immediately writes data to the\r
+     *         underlying storage, <b>false</b> if not.\r
+     */\r
+    public boolean supportsWriteSync();\r
+}\r