Author: tschneider Date: Sun Feb 18 08:45:59 2007 New Revision: 508915 URL: http://svn.apache.org/viewvc?view=rev&rev=508915 Log: WW-1740 added accessor for background process name to allow subclasses to override
Contributer: Thomas Micheline Reviewed By: Tom Schneider Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java?view=diff&rev=508915&r1=508914&r2=508915 ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java Sun Feb 18 08:45:59 2007 @@ -193,12 +193,23 @@ return new BackgroundProcess(name + "BackgroundThread", actionInvocation, threadPriority); } + /** + * Returns the name to associate the background process. Override to change the way background processes + * are mapped to requests. + * + * @param actionInvocation The action invocation + * @return the name of the background thread + */ + protected String getBackgroundProcessName(ActionProxy proxy) { + return proxy.getActionName(); + } + /* (non-Javadoc) * @see com.opensymphony.xwork2.interceptor.MethodFilterInterceptor#doIntercept(com.opensymphony.xwork2.ActionInvocation) */ protected String doIntercept(ActionInvocation actionInvocation) throws Exception { ActionProxy proxy = actionInvocation.getProxy(); - String name = proxy.getActionName(); + String name = getBackgroundProcessName(proxy); ActionContext context = actionInvocation.getInvocationContext(); Map session = context.getSession();