KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > property > PropertySetCallback


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.property.PropertySetCallback
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.property;
23
24 import org.apache.derby.iapi.error.StandardException;
25 import org.apache.derby.iapi.services.daemon.Serviceable;
26 import java.io.Serializable JavaDoc;
27 import java.util.Dictionary JavaDoc;
28
29 public interface PropertySetCallback {
30
31     /**
32         Initialize the properties for this callback.
33         Called when addPropertySetNotification() is called
34         with a non-null transaction controller.
35         This allows code to set read its initial property
36         values at boot time.
37
38         <P>
39         Code within an init() method should use the 3 argument
40         PropertyUtil method getPropertyFromSet() to obtain a property's value.
41
42         @param dbOnly true if only per-database properties are to be looked at
43         @param p the complete set of per-database properties.
44     */

45     void init(boolean dbOnly, Dictionary JavaDoc p);
46
47     /**
48       Validate a property change.
49       @param key Property key for the property being set
50       @param value proposed new value for the property being set or null if
51              the property is being dropped.
52       @param p Property set before the change. SettingProperty may read but
53              must never change p.
54
55       @return true if this object was interested in this property, false otherwise.
56       @exception StandardException Oh well.
57     */

58     boolean validate(String JavaDoc key, Serializable JavaDoc value, Dictionary JavaDoc p)
59          throws StandardException;
60     /**
61       Apply a property change. Will only be called after validate has been called
62       and only if validate returned true. If this method is called then the
63       new value is the value to be used, ie. the property is not set in the
64       overriding JVM system set.
65
66       @param key Property key for the property being set
67       @param value proposed new value for the property being set or null if
68              the property is being dropped.
69       @param p Property set before the change. SettingProperty may read but
70              must never change p.
71       @return post commit work for the property change.
72       @exception StandardException Oh well.
73     */

74     Serviceable apply(String JavaDoc key, Serializable JavaDoc value, Dictionary JavaDoc p)
75          throws StandardException;
76     
77     /**
78
79       Map a proposed new value for a property to an official value.
80
81       Will only be called after apply() has been called.
82       @param key Property key for the property being set
83       @param value proposed new value for the property being set or null if
84              the property is being dropped.
85       @param p Property set before the change. SettingProperty may read but
86              must never change p.
87       @return new value for the change
88       @exception StandardException Oh well.
89     */

90     Serializable JavaDoc map(String JavaDoc key, Serializable JavaDoc value, Dictionary JavaDoc p)
91          throws StandardException;
92 }
93
Popular Tags