Author: tschneider
Date: Sun Feb 18 08:45:30 2007
New Revision: 508914

URL: http://svn.apache.org/viewvc?view=rev&rev=508914
Log:
WW-1740 added accessor for background process name to allow subclasses to 
override

Contributer: Thomas Micheline
Reviewed By: Tom Schneider

Modified:
    
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java

Modified: 
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java?view=diff&rev=508914&r1=508913&r2=508914
==============================================================================
--- 
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java
 (original)
+++ 
struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.java
 Sun Feb 18 08:45:30 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();
 


Reply via email to