Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ApplicationStateManager |
|
| 1.0;1 |
1 | // Copyright 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // 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.engine.state; | |
16 | ||
17 | /** | |
18 | * @author Howard M. Lewis Ship | |
19 | * @since 4.0 | |
20 | */ | |
21 | public interface ApplicationStateManager | |
22 | { | |
23 | /** | |
24 | * Checks to see if the named object exists. | |
25 | * | |
26 | * @param objectName | |
27 | * the name of the application state object | |
28 | * @return True if the object with the specified name exists, false otherwise. | |
29 | * | |
30 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
31 | * If no such object is declared | |
32 | */ | |
33 | boolean exists(String objectName); | |
34 | ||
35 | /** | |
36 | * Gets the named application state object, creating it if necessary. | |
37 | * | |
38 | * @param objectName | |
39 | * the name of the application state object | |
40 | * @return the object | |
41 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
42 | * if no such object is declared | |
43 | */ | |
44 | Object get(String objectName); | |
45 | ||
46 | /** | |
47 | * Stores a new state object, replacing the old one. The | |
48 | * new object may be null. | |
49 | * | |
50 | * @param objectName the name of the object to store | |
51 | * @param stateObject the new object, possibly null | |
52 | * @throws org.apache.hivemind.ApplicationRuntimeException | |
53 | * if no such object is declared | |
54 | */ | |
55 | ||
56 | void store(String objectName, Object stateObject); | |
57 | ||
58 | /** | |
59 | * Asks each {@link StateObjectManager} to store each object obtained. | |
60 | */ | |
61 | ||
62 | void flush(); | |
63 | } |