|
|||||||||||||||||||
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
StaleSessionException.java | 100% | 100% | 100% | 100% |
|
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; | |
16 | ||
17 | import org.apache.hivemind.ApplicationRuntimeException; | |
18 | ||
19 | /** | |
20 | * Exception thrown by an {@link org.apache.tapestry.engine.IEngineService} when it discovers that | |
21 | * the {@link javax.servlet.http.HttpSession} | |
22 | * has timed out (and been replaced by a new, empty | |
23 | * one). | |
24 | * | |
25 | * <p>The application should redirect to the stale-session page. | |
26 | * | |
27 | * | |
28 | * @author Howard Lewis Ship | |
29 | * | |
30 | **/ | |
31 | ||
32 | public class StaleSessionException extends ApplicationRuntimeException | |
33 | { | |
34 | private transient IPage _page; | |
35 | private String _pageName; | |
36 | ||
37 | 2 | public StaleSessionException() |
38 | { | |
39 | 2 | this(null, null); |
40 | } | |
41 | ||
42 | 7 | public StaleSessionException(String message, IPage page) |
43 | { | |
44 | 7 | super(message, page, null, null); |
45 | 7 | _page = page; |
46 | ||
47 | 7 | if (page != null) |
48 | 5 | _pageName = page.getPageName(); |
49 | } | |
50 | ||
51 | 2 | public String getPageName() |
52 | { | |
53 | 2 | return _pageName; |
54 | } | |
55 | ||
56 | /** | |
57 | * Returns the page referenced by the service URL, if known, or null otherwise. | |
58 | * | |
59 | **/ | |
60 | ||
61 | 2 | public IPage getPage() |
62 | { | |
63 | 2 | return _page; |
64 | } | |
65 | } |
|