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 that occurs in iterative development mode when an action output attached to a {@link Forward} is of a
23: * different type than was declared.
24: */
25: public class MismatchedActionOutputException extends PageFlowException {
26: private String _actionOutputName;
27: private String _expectedType;
28: private String _actualType;
29: private String _forwardName;
30:
31: public MismatchedActionOutputException(String actionName,
32: FlowController flowController, String actionOutputName,
33: String forwardName, String expectedType, String actualType) {
34: super (actionName, flowController);
35: _actionOutputName = actionOutputName;
36: _expectedType = expectedType;
37: _actualType = actualType;
38: _forwardName = forwardName;
39: }
40:
41: protected Object[] getMessageArgs() {
42: return new Object[] { _actionOutputName, _forwardName,
43: getActionName(), getFlowControllerURI(), _actualType,
44: _expectedType };
45: }
46:
47: protected String[] getMessageParts() {
48: return new String[] { "The action output \"",
49: "\" on forward \"", "\" (action ", " in Page Flow ",
50: ") is of type ", ", but was declared to expect type ",
51: "." };
52: }
53:
54: public String getActionOutputName() {
55: return _actionOutputName;
56: }
57:
58: public String getForwardName() {
59: return _forwardName;
60: }
61:
62: public String getExpectedType() {
63: return _expectedType;
64: }
65:
66: public String getActualType() {
67: return _actualType;
68: }
69:
70: /**
71: * Tell whether the root cause may be session expiration in cases where the requested session ID is different than
72: * the actual session ID. In this case, the answer is <code>false</code>.
73: */
74: public boolean causeMayBeSessionExpiration() {
75: return false;
76: }
77: }
|