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