Joachim Draeger wrote:

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?

Can you tell me where does this happens?
I cannot find this in the code.

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.

What is "open()" ?
MailRepository does not have an open method.

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?

For the current contract the answer is no. Btw I think we only reuse keys for repositories "hard referenced" and never for weak referenced ones, so it should be safe. I think that if this helps we can "abuse" the current contract and document this aspect of the key validity for the "new" contract.

Stefano


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

Reply via email to