| 1 19 20 package za.org.coefficient.interceptors; 21 22 import za.org.coefficient.core.CoefficientInterceptor; 23 import za.org.coefficient.core.CoefficientWebContext; 24 import za.org.coefficient.interfaces.CoefficientContext; 25 import za.org.coefficient.interfaces.Invoker; 26 import za.org.coefficient.util.common.InvokerFactory; 27 28 33 public class ExecuteModuleInterceptor extends CoefficientInterceptor { 34 36 protected int handleInvoke(CoefficientContext ctx) throws Exception { 37 int retVal = INVOKE_PROCESS_CHILD; 38 39 Invoker mf = InvokerFactory.getRemoteInvoker(); 41 Object context = mf.invoke(ctx); 42 if(context instanceof CoefficientContext) { 43 ctx = (CoefficientContext)context; 44 } 45 String op = ctx.getParameter("op"); 47 String module = ctx.getParameter("module"); 48 49 if (!"showHelp".equals(op) && (module != null && !module.equals(""))) { 51 if (op == null) { 52 op = (String )mf.invokeMethodOnModule(module, "getMainMethod", 53 null); 54 } 55 ctx.setSessionAttribute(CoefficientWebContext.LAST_NON_HELP_OP, op); 56 } 57 return retVal; 58 } 59 } 60 | Popular Tags |