01: /*
02: * Created on 18 May 2007
03: */
04: package uk.org.ponder.rsf.flow.errors;
05:
06: import java.util.List;
07:
08: import uk.org.ponder.rsf.viewstate.AnyViewParameters;
09: import uk.org.ponder.rsf.viewstate.ViewParameters;
10:
11: public class ViewExceptionStrategyManager implements
12: ViewExceptionStrategy {
13: private List strategies;
14:
15: public void setStrategyList(List strategies) {
16: this .strategies = strategies;
17: }
18:
19: public AnyViewParameters handleException(Exception e,
20: ViewParameters incoming) {
21: for (int i = 0; i < strategies.size(); ++i) {
22: ViewExceptionStrategy strategy = (ViewExceptionStrategy) strategies
23: .get(i);
24: AnyViewParameters result = strategy.handleException(e,
25: incoming);
26: if (result != null)
27: return result;
28: }
29: return null;
30: }
31:
32: }
|