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 04:55:08 UTC
cvs commit: jakarta-james/src/java/org/apache/james/mailrepository JDBCSpoolRepository.java
serge 02/02/26 19:55:08
Modified: src/java/org/apache/james/mailrepository
JDBCSpoolRepository.java
Log:
Added some notes during design of this implementation. Maybe reviewing them can expose why it occassionally hangs a minute before processing the message.
Revision Changes Path
1.13 +34 -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.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- JDBCSpoolRepository.java 4 Feb 2002 15:34:11 -0000 1.12
+++ JDBCSpoolRepository.java 27 Feb 2002 03:55:08 -0000 1.13
@@ -35,6 +35,40 @@
*
* <p>Requires a logger called MailRepository.
*
+ * <p>Approach for spool manager:
+ *
+ * PendingMessage inner class
+ *
+ * accept() is called....
+ * checks whether needs to load PendingMessages()
+ * tries to get a message()
+ * if none, wait 60
+ *
+ * accept(long) is called
+ * checks whether needs to load PendingMessages
+ * tries to get a message(long)
+ * if none, wait accordingly
+ *
+ * sync checkswhetherneedstoloadPendingMessages()
+ * if pending messages has messages in immediate process, return immediately
+ * if run query in last WAIT_LIMIT time, return immediately
+ * query and build 2 vectors of Pending messages.
+ * Ones that need immediate processing
+ * Ones that are delayed. put them in time order
+ * return
+ *
+ * get_a_message()
+ * loop through immediate messages.
+ * - remove top message
+ * - try to lock. if successful, return. otherwise loop.
+ * if nothing, return null
+ *
+ * get_a_message(long)
+ * try get_a_message()
+ * check top message in pending. if ready, then remove, try to lock, return if lock.
+ * return null.
+ *
+ *
* @version 1.0.0, 24/04/1999
* @author Serge Knystautas <se...@lokitech.com>
*/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>