1. opensymphony
  2. webwork

Commits

mbogaert  committed e1687dc

Don't you just hate nameless threads or threads where you cannot specify the priority?

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@589573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 897574c
  • Branches master

Comments (0)

Files changed (1)

File src/java/com/opensymphony/webwork/interceptor/ExecuteAndWaitInterceptor.java

View file
 
     public static final String KEY = "__execWait";
 
-    //~ Methods ////////////////////////////////////////////////////////////////
+    //~ Instance fields ////////////////////////////////////////////////////////
 
-    public void destroy() {
-    }
+    private int threadPriority = Thread.NORM_PRIORITY;
+
+    //~ Methods ////////////////////////////////////////////////////////////////
 
     public void init() {
     }
             BackgroundProcess bp = (BackgroundProcess) session.get(KEY + name);
 
             if (bp == null) {
-                bp = new BackgroundProcess(actionInvocation);
+                bp = new BackgroundProcess(name + "BackgroundThread", actionInvocation, threadPriority);
                 session.put(KEY + name, bp);
             }
 
         }
     }
 
+
+    public void destroy() {
+    }
+
+    public void setThreadPriority(int threadPriority) {
+        this.threadPriority = threadPriority;
+    }
+
     //~ Inner Classes //////////////////////////////////////////////////////////
 
     static class BackgroundProcess implements Serializable {
         private String result;
         private boolean done;
 
-        public BackgroundProcess(final ActionInvocation invocation) {
+        public BackgroundProcess(final String threadName, final ActionInvocation invocation, final int threadPriority) {
             this.invocation = invocation;
             this.action = invocation.getAction();
 
                     done = true;
                 }
             });
+            t.setName(threadName);
+            t.setPriority(threadPriority);
             t.start();
         }
 
             return action;
         }
 
+        public ActionInvocation getInvocation() {
+            return invocation;
+        }
+
         public String getResult() {
             return result;
         }