|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ShowEngine.java | 0% | 0% | 0% | 0% |
|
1 | // Copyright 2004, 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.contrib.inspector; | |
16 | ||
17 | import java.util.Collections; | |
18 | import java.util.List; | |
19 | ||
20 | import org.apache.tapestry.BaseComponent; | |
21 | import org.apache.tapestry.event.PageBeginRenderListener; | |
22 | import org.apache.tapestry.event.PageEvent; | |
23 | import org.apache.tapestry.web.WebRequest; | |
24 | import org.apache.tapestry.web.WebSession; | |
25 | ||
26 | /** | |
27 | * Component of the {@link Inspector} page used to display the properties of the | |
28 | * {@link org.apache.tapestry.IEngine} as well as a serialized view of it. Also, the | |
29 | * {@link org.apache.tapestry.request.RequestContext} is dumped out. | |
30 | * | |
31 | * @author Howard Lewis Ship | |
32 | */ | |
33 | ||
34 | public abstract class ShowEngine extends BaseComponent implements PageBeginRenderListener | |
35 | { | |
36 | // Injected | |
37 | public abstract WebRequest getRequest(); | |
38 | ||
39 | // Transient | |
40 | public abstract void setSessionAttributeNames(List names); | |
41 | ||
42 | // Transient | |
43 | public abstract void setSession(WebSession session); | |
44 | ||
45 | 0 | public void pageBeginRender(PageEvent event) |
46 | { | |
47 | 0 | WebSession session = getRequest().getSession(false); |
48 | ||
49 | 0 | setSession(session); |
50 | ||
51 | 0 | setSessionAttributeNames(session == null ? Collections.EMPTY_LIST : session |
52 | .getAttributeNames()); | |
53 | } | |
54 | ||
55 | } |
|