You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/04/23 16:24:58 UTC

svn commit: r1792375 - /axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java

Author: veithen
Date: Sun Apr 23 16:24:58 2017
New Revision: 1792375

URL: http://svn.apache.org/viewvc?rev=1792375&view=rev
Log:
Fix compiler warnings and remove dead/unused code.

Modified:
    axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java

Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java?rev=1792375&r1=1792374&r2=1792375&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/sample/parallelasync/server/DocLitWrappedPortImpl.java Sun Apr 23 16:24:58 2017
@@ -58,14 +58,7 @@ public class DocLitWrappedPortImpl imple
     //       the key is the request string
     //       the value is the object used to block on
     //
-    private static Hashtable sleepers = new Hashtable();
-
-    // intended to flag the need to cancel current requests being held (ie, sleeping)
-    // does not stop new requests
-    // not settable yet
-    // need to determine when to reset it when dealing with multiple operations
-    // currently reset when the sleepers table doesn't have any more requests
-    private static boolean doCancell = false;
+    private static Hashtable<String,Thread> sleepers = new Hashtable<String,Thread>();
 
     // strings used for logging
     private String myClassName = "DocLitWrappedPortImpl.";
@@ -84,13 +77,9 @@ public class DocLitWrappedPortImpl imple
      */
     public void sleep(Holder<String> request) {
 
-        boolean cancelRequested = false;
-
-        String key = new String(request.value);
-        String msg = request.value;
+        String key = request.value;
 
-        String title = myClassName+"sleep("+msg+"): ";
-        String tid = " threadID ["+ Thread.currentThread().getId() + "] ";
+        String title = myClassName+"sleep("+key+"): ";
         //if (DEBUG)
         //{
         //    System.out.println(title + tid + "Enter");
@@ -123,7 +112,7 @@ public class DocLitWrappedPortImpl imple
             //  - the wait is interrupted
             //  - a cancel occurs
 
-            while (sec > 0 && !doCancell) {
+            while (sec > 0) {
                 if (DEBUG)
                     TestLogger.logger.debug(title + "Sleeping on "
                             + " threadID [" + threadID + "]"
@@ -131,7 +120,7 @@ public class DocLitWrappedPortImpl imple
                 sec--;
 
                 //msg.wait(500);
-                myThread.sleep(500);
+                Thread.sleep(500);
             }
 
         } 
@@ -150,13 +139,6 @@ public class DocLitWrappedPortImpl imple
 
             // remove this request from the list
             sleepers.remove(key);
-
-            // for now, reset the cancellation flag when the list of 
-            // waiting requests go to zero
-            if (sleepers.isEmpty())
-            {
-                doCancell = false;
-            }
         }
 
     }