01: /*
02: * $Id: IPageMapEntry.java 458720 2006-01-17 13:53:59Z jcompagner $
03: * $Revision: 458720 $ $Date: 2006-01-17 14:53:59 +0100 (Tue, 17 Jan 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.session.pagemap;
19:
20: import java.io.Serializable;
21:
22: import wicket.Page;
23:
24: /**
25: * Some source which produces a page. Page implements IPageMapEntry by simply
26: * returning "this", but other implementations are possible as well, allowing
27: * users to create IPageMapEntry implementations that reconstruct full blown
28: * Page objects from a limited set of data (for example, a details page from an
29: * id). The advantage of doing this is that you can save session memory (by
30: * trading off against the processing power required to reconstruct the page).
31: *
32: * @see wicket.session.pagemap.AbstractPageMapEntry
33: * @author Jonathan Locke
34: */
35: public interface IPageMapEntry extends Serializable {
36: /**
37: * @return A stable identifier for this page map entry
38: */
39: int getNumericId();
40:
41: /**
42: * @return Gets the page, possibly creating it on the fly.
43: */
44: Page getPage();
45:
46: /**
47: * @return The class of page stored in this page map entry (which can be
48: * used by an eviction strategy to prioritize evictions)
49: */
50: Class getPageClass();
51:
52: /**
53: * @param id
54: * The numeric id for this entry
55: */
56: void setNumericId(int id);
57: }
|