1 16 package org.springframework.webflow.engine; 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 20 import org.springframework.webflow.execution.Action; 21 import org.springframework.webflow.execution.Event; 22 import org.springframework.webflow.execution.RequestContext; 23 24 32 public class ActionExecutor { 33 34 private static final Log logger = LogFactory.getLog(ActionExecutor.class); 35 36 39 private ActionExecutor() { 40 } 41 42 50 public static Event execute(Action action, RequestContext context) throws ActionExecutionException { 51 try { 52 if (logger.isDebugEnabled()) { 53 if (context.getCurrentState() == null) { 54 logger.debug("Executing start " + action + " for flow '" + context.getActiveFlow().getId() + "'"); 55 } 56 else { 57 logger.debug("Executing " + action + " in state '" + context.getCurrentState().getId() 58 + "' of flow '" + context.getActiveFlow().getId() + "'"); 59 } 60 } 61 return action.execute(context); 62 } 63 catch (ActionExecutionException e) { 64 throw e; 65 } 66 catch (Exception e) { 67 throw new ActionExecutionException(context.getActiveFlow().getId(), 69 context.getCurrentState() != null ? context.getCurrentState().getId() : null, action, context 70 .getAttributes(), e); 71 } 72 } 73 } | Popular Tags |