Stefano Bagnara wrote:
1. Why MailRepository gets configured on startup?
Every MAIL repository used by ToRepository and FromRepository mailets, the SPOOL repository used by RemoteDelivery and the main SPOOL repository used by the JamesSpoolManager (localspoolrepository) are created/configured when the components are initialized.

On startup a MailRepository object gets configured with destinationURL="whatever://var/mail/inboxes/" and initialized. That MailRepository object won't ever be used. So I shouldn't do anything in initialize method at that time, but how can I determine that?

When a MailRepository is demanded for a specific user it get's configured with destinationURL="whatever://var/mail/inboxes/username".

Of course I can add "if (!open) open();" to every store, list, remove method, but I just wonder if there is a better way.

There is a weak cache: James tries to keep the mbox references in memory, but if no one has reference it may gc them.

3. How long are the message keys (names) valid?
Does it fulfill the contract completely to cache keys for the lifetime of the MailRepository object?

James expect to store mails under a given key and to be able to retrieve the same mail using the same key. There is no "persistence" of key as references so it's safe to change keys between restarts.

Okay, but MailRepository maybe gc away. Is it sufficient to keep keys valid for the lifetime of the MailRepository?

Joachim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to