01: // Copyright 2006, 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // Unless required by applicable law or agreed to in writing, software
10: // distributed under the License is distributed on an "AS IS" BASIS,
11: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: // See the License for the specific language governing permissions and
13: // limitations under the License.
14:
15: package org.apache.tapestry.services;
16:
17: import org.apache.tapestry.ComponentResources;
18:
19: /**
20: * Handle persistent property changes. Primarily, delegates to a number of
21: * {@link PersistentFieldStrategy} instances.
22: */
23: public interface PersistentFieldManager {
24: /**
25: * Posts a change of a persistent property.
26: *
27: * @param pageName
28: * the logical name of the page containing the component
29: * @param resources
30: * the resources for the component or mixin (used to determine the persistence
31: * strategy)
32: * @param fieldName
33: * the name of the field whose persistent value has changed
34: * @param newValue
35: * the new value for the field, possibly null
36: */
37: void postChange(String pageName, ComponentResources resources,
38: String fieldName, Object newValue);
39:
40: /**
41: * Locates all persistently stored changes to all properties within the page (for the current
42: * session and request) and gathers them together into a bundle.
43: *
44: * @param pageName
45: * the logical name of the page to gather changes for
46: * @return a bundle identifying all such changes
47: */
48: PersistentFieldBundle gatherChanges(String pageName);
49: }
|