1 7 package com.inversoft.verge.mvc.controller.actionflow.test; 8 9 10 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowAction; 11 import com.inversoft.verge.mvc.controller.actionflow.ActionFlowException; 12 13 14 19 public class ActionHandler { 20 21 public static boolean called; 22 public static boolean logoutCalled; 23 public static boolean step1; 24 public static boolean step2; 25 26 27 30 public ActionHandler() { 31 called = false; 32 logoutCalled = false; 33 } 34 35 36 39 public Object handleLogin(ActionFlowAction state) { 40 called = true; 41 System.out.println("Handling login in ActionHandler"); 42 return "success"; 43 } 44 45 48 public Object handleLogout(ActionFlowAction state) { 49 logoutCalled = true; 50 System.out.println("Handling logout in ActionHandler"); 51 return "success"; 52 } 53 54 57 public Object handleFailure(ActionFlowAction state) throws Exception { 58 called = true; 59 System.out.println("Handling failure in ActionHandler"); 60 throw new Exception ("Failure"); 61 } 62 63 66 public Object handleFailure2(ActionFlowAction state) throws Exception { 67 called = true; 68 System.out.println("Handling failure2 in ActionHandler"); 69 throw new ActionFlowException("Failure2"); 70 } 71 72 75 public Object handleTwoStep(ActionFlowAction action) { 76 System.out.println("Handling twoStep"); 77 step1 = true; 78 return "twoStepPartTwo"; 79 } 80 81 84 public Object handleTwoStepPartTwo(ActionFlowAction action) { 85 System.out.println("Handling twoStepPartTtwo"); 86 step2 = true; 87 return "success"; 88 } 89 90 93 public Object handleThreeStep1(ActionFlowAction action) { 94 System.out.println("Handling threeStep1"); 95 step1 = true; 96 return "threeStep2"; 97 } 98 99 102 public Object handleThreeStep2(ActionFlowAction action) { 103 System.out.println("Handling threeStep2"); 104 step2 = true; 105 return "threeStep3"; 106 } 107 108 111 public static boolean isCalled() { 112 return called; 113 } 114 115 118 public static boolean isLogoutCalled() { 119 return logoutCalled; 120 } 121 } | Popular Tags |