KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > UnresolvableForwardException


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow;
19
20
21 /**
22  * Exception thrown by {@link Forward} when its name does not resolve to one defined by a
23  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Forward @Jpf.Forward} annotation in the current action's
24  * {@link org.apache.beehive.netui.pageflow.annotations.Jpf.Action @Jpf.Action} annotation.
25  */

26 public class UnresolvableForwardException extends PageFlowException
27 {
28     private String JavaDoc _forwardName;
29
30     /**
31      * Constructor.
32      *
33      * @param forwardName the name of the unresolvable {@link Forward}.
34      */

35     public UnresolvableForwardException( String JavaDoc forwardName, String JavaDoc actionName, FlowController fc )
36     {
37         super( actionName, fc );
38         _forwardName = forwardName;
39     }
40
41     /**
42      * Get the name of the unresolvable {@link Forward}.
43      *
44      * @return a String that is the name of the unresolvable {@link Forward}.
45      */

46     public String JavaDoc getForwardName()
47     {
48         return _forwardName;
49     }
50
51     /**
52      * Set the name of the unresolvable {@link Forward}.
53      *
54      * @param forwardName a String that is the name of the unresolvable {@link Forward}.
55      */

56     public void setForwardName( String JavaDoc forwardName )
57     {
58         _forwardName = forwardName;
59     }
60
61     protected Object JavaDoc[] getMessageArgs()
62     {
63         return new Object JavaDoc[]{ _forwardName, getActionName(), getFlowControllerURI() };
64     }
65
66     public String JavaDoc[] getMessageParts()
67     {
68         return new String JavaDoc[]
69         {
70             "Unable to find a forward named \"", "\" on action ", " in Page Flow ", "."
71         };
72     }
73
74     /**
75      * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
76      * the actual session ID. In this case, the answer is <code>false</code>.
77      */

78     public boolean causeMayBeSessionExpiration()
79     {
80         return false;
81     }
82 }
83
Popular Tags