axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/transport/http SimpleAxisServer.java
Date Thu, 01 Aug 2002 16:16:52 GMT
rubys       2002/08/01 09:16:52

  Modified:    java/src/org/apache/axis/transport/http
                        SimpleAxisServer.java
  Log:
  Restore single threading to SimpleAxisServer.  See first comment line in
  this source file.  We can argue later over what the default should be,
  but for now, I'm trying to eliminate variables in tracking down the
  intermittent gump failures.
  
  Revision  Changes    Path
  1.70      +19 -7     xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java
  
  Index: SimpleAxisServer.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/SimpleAxisServer.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- SimpleAxisServer.java	10 Jul 2002 19:32:14 -0000	1.69
  +++ SimpleAxisServer.java	1 Aug 2002 16:16:51 -0000	1.70
  @@ -94,6 +94,9 @@
       // cleanup policy).
       private Hashtable sessions = new Hashtable();
   
  +    // Are we doing threads?
  +    private static boolean doThreads = false;
  +
       // Are we doing sessions?
       // Set this to false if you don't want any session overhead.
       private static boolean doSessions = true;
  @@ -156,9 +159,13 @@
               }
               if (socket != null) {
                   SimpleAxisWorker worker = new SimpleAxisWorker(this, socket);
  -                Thread thread = new Thread(worker);
  -                thread.setDaemon(true);
  -                thread.start();
  +                if (doThreads) {
  +                    Thread thread = new Thread(worker);
  +                    thread.setDaemon(true);
  +                    thread.start();
  +                } else {
  +                    worker.run();
  +                }
               }
           }
           log.info(JavaUtils.getMessage("quit00", "SimpleAxisServer"));
  @@ -166,7 +173,6 @@
   
       // per thread socket information
       private ServerSocket serverSocket;
  -    private volatile Thread worker = null;
   
       /**
        * Obtain the serverSocket that that SimpleAxisServer is listening on.
  @@ -192,9 +198,13 @@
        * @param daemon a boolean indicating if the thread should be a daemon.
        */
       public void start(boolean daemon) throws Exception {
  -        worker = new Thread(this);
  -        worker.setDaemon(daemon);
  -        worker.start();
  +        if (doThreads) {
  +            Thread thread = new Thread(this);
  +            thread.setDaemon(daemon);
  +            thread.start();
  +        } else {
  +            run();
  +        }
       }
   
       /**
  @@ -243,6 +253,8 @@
           }
   
           try {
  +            doThreads = (opts.isFlagSet('t') > 0);
  +
               int port = opts.getPort();
               ServerSocket ss = null;
               // Try five times
  
  
  

Mime
View raw message