axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r328888 - in /webservices/axis2/trunk/java/modules/core: src/org/apache/axis2/clientapi/ src/org/apache/axis2/receivers/ src/org/apache/axis2/transport/mail/ src/org/apache/axis2/transport/tcp/ src/org/apache/axis2/util/threadpool/ test/org...
Date Thu, 27 Oct 2005 14:59:29 GMT
Author: dims
Date: Thu Oct 27 07:59:23 2005
New Revision: 328888

URL: http://svn.apache.org/viewcvs?rev=328888&view=rev
Log:
slightly reworked patch from chamil for threadpool


Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadFactory.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
    webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/clientapi/InOutMEPClient.java
Thu Oct 27 07:59:23 2005
@@ -245,9 +245,8 @@
                 //send the message
                 engine.send(msgctx);
             } else {
-                //here a bloking invocation happens in a new thrad, so the progamming model
is
-                //non blocking
-                serviceContext.getConfigurationContext().getThreadPool().newThread(new NonBlockingInvocationWorker(callback,
axisop, msgctx));
+                //here a bloking invocation happens in a new thread, so the progamming model
is non blocking
+                 serviceContext.getConfigurationContext().getThreadPool().execute(new NonBlockingInvocationWorker(callback,
axisop, msgctx));
             }
 
         } catch (OMException e) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/receivers/AbstractInOutAsyncMessageReceiver.java
Thu Oct 27 07:59:23 2005
@@ -59,7 +59,7 @@
                 }
             }
         };
-        (new Thread(theadedTask)).start();
+        messageCtx.getSystemContext().getThreadPool().execute(theadedTask);
     }
 
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/mail/SimpleMailListener.java
Thu Oct 27 07:59:23 2005
@@ -206,9 +206,7 @@
         }
 
         if (doThreads) {
-            Thread thread = new Thread(this);
-            thread.setDaemon(daemon);
-            thread.start();
+        	this.configurationContext.getThreadPool().execute(this);
         } else {
             run();
         }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPServer.java
Thu Oct 27 07:59:23 2005
@@ -84,7 +84,7 @@
                 break;
             }
             if (socket != null) {
-                configContext.getThreadPool().newThread(
+                configContext.getThreadPool().execute(
                         new TCPWorker(configContext, socket));
             }
         }
@@ -96,8 +96,7 @@
             serversocket = ListenerManager.openSocket(port);
         }
         started = true;
-        Thread thread = new Thread(this);
-        thread.start();
+        this.configContext.getThreadPool().execute(this);
     }
 
     /* (non-Javadoc)

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadFactory.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadFactory.java
Thu Oct 27 07:59:23 2005
@@ -1,5 +1,6 @@
-package org.apache.axis2.util.threadpool;
-
-public interface ThreadFactory {
-    public void newThread(java.lang.Runnable runnable);
+package org.apache.axis2.util.threadpool;
+
+public interface ThreadFactory {
+    //public void newThread(java.lang.Runnable runnable);
+    public void execute(java.lang.Runnable runnable);
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/threadpool/ThreadPool.java
Thu Oct 27 07:59:23 2005
@@ -55,7 +55,7 @@
 
     }
 
-    public void newThread(Runnable worker) {
+    public void execute(Runnable worker){
         if (shutDown)
             throw new RuntimeException(Messages.getMessage("threadpoolshutdown"));
         tasks.add(worker);

Modified: webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java?rev=328888&r1=328887&r2=328888&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java
(original)
+++ webservices/axis2/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java
Thu Oct 27 07:59:23 2005
@@ -34,7 +34,7 @@
         for (int i = 0; i < 5; i++) {
             TestWorker worker = new TestWorker();
             workerList.add(worker);
-            tPool.newThread(worker);
+            tPool.execute(worker);
         }
 
         tPool.safeShutDown();



Mime
View raw message