KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > StaleSessionException


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 JavaDoc _pageName;
36
37     public StaleSessionException()
38     {
39         this(null, null);
40     }
41
42     public StaleSessionException(String JavaDoc message, IPage page)
43     {
44         super(message, page, null, null);
45         _page = page;
46
47         if (page != null)
48             _pageName = page.getPageName();
49     }
50
51     public String JavaDoc getPageName()
52     {
53         return _pageName;
54     }
55
56     /**
57      * Returns the page referenced by the service URL, if known, or null otherwise.
58      *
59      **/

60
61     public IPage getPage()
62     {
63         return _page;
64     }
65 }
Popular Tags