Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / iapi / services / property / PropertyFactory.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/services/property/PropertyFactory.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/iapi/services/property/PropertyFactory.java
new file mode 100644 (file)
index 0000000..9ecbef2
--- /dev/null
@@ -0,0 +1,116 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.iapi.services.property.PropertyFactory\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.iapi.services.property;\r
+\r
+import org.apache.derby.catalog.UUID;\r
+\r
+import org.apache.derby.iapi.services.context.ContextManager;\r
+import org.apache.derby.iapi.services.locks.LockFactory;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.store.access.TransactionController;\r
+import org.apache.derby.iapi.store.access.conglomerate.MethodFactory;\r
+\r
+import org.apache.derby.iapi.services.property.PropertySetCallback;\r
+import java.util.Properties;\r
+import java.io.File;\r
+import java.io.Serializable;\r
+import java.util.Dictionary;\r
+\r
+/**\r
+  Module interface for an Property validation.  \r
+\r
+  <p>\r
+  An PropertyFactory is typically obtained from the Monitor:\r
+  <p>\r
+  <blockquote><pre>\r
+       // Get the current validation factory.\r
+       PropertyFactory af;\r
+       af = (PropertyFactory) Monitor.findServiceModule(this, org.apache.derby.iapi.reference.Module.PropertyFactory);\r
+  </pre></blockquote>\r
+**/\r
+\r
+public interface PropertyFactory\r
+{\r
+    /**************************************************************************\r
+     * methods that are Property related.\r
+     **************************************************************************\r
+     */\r
+\r
+    /**\r
+     * Add a callback for a change in any property value.\r
+        * <BR>\r
+     * The callback is made in the context of the transaction making the change.\r
+     *\r
+     * @param who   which object is called\r
+     **/\r
+       public void addPropertySetNotification(\r
+    PropertySetCallback     who);\r
+\r
+    /**\r
+     * Validate a Property set.\r
+     * <p>\r
+     * Validate a Property set by calling all the registered property set\r
+     * notification functions with .\r
+     *\r
+        * @param p Properties to validate.\r
+        * @param ignore Properties to not validate in p. Usefull for properties\r
+        *        that may not be set after boot. \r
+     *\r
+        * @exception StandardException Throws if p fails a check.\r
+     **/\r
+       public void verifyPropertySet(\r
+    Properties p, \r
+    Properties ignore) \r
+        throws StandardException;\r
+\r
+       /**\r
+        * validation a single property\r
+        */\r
+       public void validateSingleProperty(String key,\r
+                                                 Serializable value,\r
+                                                 Dictionary set)\r
+               throws StandardException;\r
+\r
+       /**\r
+          \r
+        */\r
+       public Serializable doValidateApplyAndMap(TransactionController tc,\r
+                                                                                        String key, Serializable value,\r
+                                                                                        Dictionary d, boolean dbOnlyProperty)\r
+               throws StandardException;\r
+\r
+\r
+       /**\r
+         Call the property set callbacks to map a proposed property value\r
+         to a value to save.\r
+         <P>\r
+         The caller must run this in a block synchronized on this\r
+         to serialize validations with changes to the set of\r
+         property callbacks\r
+         */\r
+       public Serializable doMap(String key,\r
+                                                        Serializable value,\r
+                                                        Dictionary set)\r
+               throws StandardException;\r
+}\r