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 se...@apache.org on 2002/02/27 05:05:11 UTC
cvs commit: jakarta-james/src/java/org/apache/james/mailrepository JDBCMailRepository.java JDBCSpoolRepository.java
serge 02/02/26 20:05:11
Modified: src/java/org/apache/james/mailrepository
JDBCMailRepository.java JDBCSpoolRepository.java
Log:
Sure enough, reviewing the logic exposed the fact that the spool would know reload the list of pending messages until the time expired. Changed to override the store method to reset the timer.
Revision Changes Path
1.17 +4 -0 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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- JDBCMailRepository.java 18 Jan 2002 02:48:36 -0000 1.16
+++ JDBCMailRepository.java 27 Feb 2002 04:05:11 -0000 1.17
@@ -274,6 +274,10 @@
}
}
+ /**
+ * Store this message to the database. Optionally stores the message
+ * body to the filesystem and only writes the headers to the database.
+ */
public void store(MailImpl mc) {
//System.err.println("storing " + mc.getName());
Connection conn = null;
1.14 +12 -0 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.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- JDBCSpoolRepository.java 27 Feb 2002 03:55:08 -0000 1.13
+++ JDBCSpoolRepository.java 27 Feb 2002 04:05:11 -0000 1.14
@@ -8,6 +8,7 @@
package org.apache.james.mailrepository;
import org.apache.james.services.SpoolRepository;
+import org.apache.james.core.MailImpl;
import org.apache.mailet.Mail;
import java.sql.Connection;
@@ -162,6 +163,17 @@
}
}
+ }
+
+ /**
+ * Needs to override this method and reset the time to load to zero.
+ * This will force a reload of the pending messages queue once that
+ * is empty... a message that gets added will sit here until that queue
+ * time has passed and the list is then reloaded.
+ */
+ public void store(MailImpl mc) {
+ pendingMessagesLoadTime = 0;
+ super.store(mc);
}
/**
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>