|
|||||||||||||||||||
| 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 | 3 | public StaleSessionException() |
| 40 | { | |
| 41 | 3 | this(null, null); |
| 42 | } | |
| 43 | ||
| 44 | 18 | public StaleSessionException(String message, IPage page) |
| 45 | { | |
| 46 | 18 | super(message, page, null, null); |
| 47 | 18 | _page = page; |
| 48 | ||
| 49 | 18 | if (page != null) |
| 50 | 15 | _pageName = page.getPageName(); |
| 51 | } | |
| 52 | ||
| 53 | 6 | public String getPageName() |
| 54 | { | |
| 55 | 6 | return _pageName; |
| 56 | } | |
| 57 | ||
| 58 | /** | |
| 59 | * Returns the page referenced by the service URL, if known, or null otherwise. | |
| 60 | * | |
| 61 | **/ | |
| 62 | ||
| 63 | 6 | public IPage getPage() |
| 64 | { | |
| 65 | 6 | return _page; |
| 66 | } | |
| 67 | } |
|
||||||||||