diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/ISystemService.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/ISystemService.java
index fea7399712a..a25b6dcc77e 100644
--- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/ISystemService.java
+++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/ISystemService.java
@@ -26,4 +26,13 @@ public interface ISystemService
* @param client the object of the client
*/
public void setThreadSecurity(Client client);
+
+ /**
+ * This method is used to execute run() in a thread assigned
+ * from thread pools.
+ *
+ * @param securedThread the securedThread object that implements
+ * Runnable.
+ */
+ public void executeThread(SecuredThread securedThread);
}
diff --git a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/SecuredThread.java b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/SecuredThread.java
index 46e7ca78ae9..db5aa6989c0 100644
--- a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/SecuredThread.java
+++ b/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/core/server/SecuredThread.java
@@ -132,6 +132,32 @@ public class SecuredThread extends Thread
super.run();
}
-
+
+ /**
+ * When start() is called, a check is made to see if there is an ISystemService.
+ * If there is, the ISystemService.executeThread(SecuredThread)
is called.
+ * In this case, the run() method is invoked in a thread assigned from the running
+ * work threads
+ * If there isn't, the super.start()
is called.
+ * In this case. the run() method is invoked as a new thread.
+ */
+ public void start()
+ {
+ try
+ {
+ ISystemService systemService = SystemServiceManager.getInstance().getSystemService();
+ if (systemService != null){
+ systemService.executeThread(this);
+ }
+ else
+ {
+ super.start();
+ }
+ }
+ catch(Throwable e)
+ {
+ e.printStackTrace(new PrintWriter(System.err));
+ }
+ }
}