Implementation of a SpoolRepository on a database.
Requires a configuration element in the .conf.xml file of the form:
<repository destinationURL="town://path"
type="MAIL"
model="SYNCHRONOUS"/>
<driver>sun.jdbc.odbc.JdbcOdbcDriver</conn>
<conn>jdbc:odbc:LocalDB</conn>
<table>Message</table>
</repository>
destinationURL specifies..(Serge??)
Type can be SPOOL or MAIL
Model is currently not used and may be dropped
conn is the location of the ...(Serge)
table is the name of the table in the Database to be used
Requires a logger called MailRepository.
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. |