01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow;
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: private String _forwardName;
28:
29: /**
30: * Constructor.
31: *
32: * @param forwardName the name of the unresolvable {@link Forward}.
33: */
34: public UnresolvableForwardException(String forwardName,
35: String actionName, FlowController fc) {
36: super (actionName, fc);
37: _forwardName = forwardName;
38: }
39:
40: /**
41: * Get the name of the unresolvable {@link Forward}.
42: *
43: * @return a String that is the name of the unresolvable {@link Forward}.
44: */
45: public String getForwardName() {
46: return _forwardName;
47: }
48:
49: /**
50: * Set the name of the unresolvable {@link Forward}.
51: *
52: * @param forwardName a String that is the name of the unresolvable {@link Forward}.
53: */
54: public void setForwardName(String forwardName) {
55: _forwardName = forwardName;
56: }
57:
58: protected Object[] getMessageArgs() {
59: return new Object[] { _forwardName, getActionName(),
60: getFlowControllerURI() };
61: }
62:
63: public String[] getMessageParts() {
64: return new String[] { "Unable to find a forward named \"",
65: "\" on action ", " in Page Flow ", "." };
66: }
67:
68: /**
69: * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
70: * the actual session ID. In this case, the answer is <code>false</code>.
71: */
72: public boolean causeMayBeSessionExpiration() {
73: return false;
74: }
75: }
|