You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2003/05/07 05:12:03 UTC

cvs commit: jakarta-james/src/java/org/apache/james/mailrepository AvalonMailRepository.java JDBCMailRepository.java JDBCSpoolRepository.java

noel        2003/05/06 20:12:03

  Modified:    src/java/org/apache/james/mailrepository Tag: branch_2_1_fcs
                        AvalonMailRepository.java JDBCMailRepository.java
                        JDBCSpoolRepository.java
  Log:
  Changed notify/wait code in spooler - only store() wakes waiting threads in accept(), and wakes only one
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.20.4.5  +8 -7      jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.20.4.4
  retrieving revision 1.20.4.5
  diff -u -r1.20.4.4 -r1.20.4.5
  --- AvalonMailRepository.java	8 Mar 2003 21:54:03 -0000	1.20.4.4
  +++ AvalonMailRepository.java	7 May 2003 03:12:02 -0000	1.20.4.5
  @@ -233,9 +233,9 @@
                               .append(new java.util.Date(System.currentTimeMillis()));
                   getLogger().debug(debugBuffer.toString());
               }
  -            synchronized (this) {
  -                notifyAll();
  -            }
  +//            synchronized (this) {
  +//                notifyAll();
  +//            }
               return true;
           } else {
               return false;
  @@ -262,9 +262,9 @@
                               .append(new java.util.Date(System.currentTimeMillis()));
                   getLogger().debug(debugBuffer.toString());
               }
  -            synchronized (this) {
  -                notifyAll();
  -            }
  +//            synchronized (this) {
  +//                notifyAll();
  +//            }
               return true;
           } else {
               return false;
  @@ -346,7 +346,8 @@
               }
   
               synchronized (this) {
  -                notifyAll();
  +//                notifyAll();
  +                notify();
               }
           } catch (Exception e) {
               getLogger().error("Exception storing mail: " + e);
  
  
  
  1.30.4.5  +3 -2      jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java
  
  Index: JDBCMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java,v
  retrieving revision 1.30.4.4
  retrieving revision 1.30.4.5
  diff -u -r1.30.4.4 -r1.30.4.5
  --- JDBCMailRepository.java	8 Mar 2003 21:54:03 -0000	1.30.4.4
  +++ JDBCMailRepository.java	7 May 2003 03:12:02 -0000	1.30.4.5
  @@ -441,7 +441,7 @@
                               .append(new java.util.Date(System.currentTimeMillis()));
                   getLogger().debug(debugBuffer.toString());
               }
  -            notifyAll();
  +//            notifyAll();
               return true;
           } else {
               return false;
  @@ -642,7 +642,8 @@
               conn.setAutoCommit(true);
   
               synchronized (this) {
  -                notifyAll();
  +//                notifyAll();
  +                notify();
               }
           } catch (Exception e) {
               e.printStackTrace();
  
  
  
  1.15.4.4  +5 -4      jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java
  
  Index: JDBCSpoolRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCSpoolRepository.java,v
  retrieving revision 1.15.4.3
  retrieving revision 1.15.4.4
  diff -u -r1.15.4.3 -r1.15.4.4
  --- JDBCSpoolRepository.java	8 Mar 2003 21:54:04 -0000	1.15.4.3
  +++ JDBCSpoolRepository.java	7 May 2003 03:12:02 -0000	1.15.4.4
  @@ -166,7 +166,8 @@
                       //            .append(" in ")
                       //            .append(repositoryName);
                       //System.err.println(errorBuffer.toString());
  -                    wait(WAIT_LIMIT);
  +//                    wait(WAIT_LIMIT);
  +                    wait(); // we'll be woken by store() calling notify()
                   }
               } catch (InterruptedException ex) {
                   throw ex;
  @@ -210,9 +211,9 @@
                   }
               }
               //Nothing to do... sleep!
  -            if (sleepUntil == 0) {
  -                sleepUntil = System.currentTimeMillis() + WAIT_LIMIT;
  -            }
  +//            if (sleepUntil == 0) {
  +//                sleepUntil = System.currentTimeMillis() + WAIT_LIMIT;
  +//            }
               try {
                   synchronized (this) {
                       long waitTime = sleepUntil - System.currentTimeMillis();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org