|
|||||||||||||||||||
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 static final long serialVersionUID = 6733303549871198597L; | |
35 | ||
36 | private transient IPage _page; | |
37 | private String _pageName; | |
38 | ||
39 | 2 | public StaleSessionException() |
40 | { | |
41 | 2 | this(null, null); |
42 | } | |
43 | ||
44 | 12 | public StaleSessionException(String message, IPage page) |
45 | { | |
46 | 12 | super(message, page, null, null); |
47 | 12 | _page = page; |
48 | ||
49 | 12 | if (page != null) |
50 | 10 | _pageName = page.getPageName(); |
51 | } | |
52 | ||
53 | 4 | public String getPageName() |
54 | { | |
55 | 4 | return _pageName; |
56 | } | |
57 | ||
58 | /** | |
59 | * Returns the page referenced by the service URL, if known, or null otherwise. | |
60 | * | |
61 | **/ | |
62 | ||
63 | 4 | public IPage getPage() |
64 | { | |
65 | 4 | return _page; |
66 | } | |
67 | } |
|