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.

I don't know where and why it happens exactly. But I found something in the mailstore.log: (at startup)

Ok, James.init. This is probably only to check that the folder exists.
Maybe this is a bug because the repositoryUrl for the inboxes configuration is only a prefix for the real repository....

----
        Configuration inboxConf = conf.getChild("inboxRepository");
        Configuration inboxRepConf = inboxConf.getChild("repository");
// we could delete this block. I didn't remove this because I'm not sure
        // wether we need the "check" of the inbox repository here, or not.
        try {
            store.select(inboxRepConf);
        } catch (Exception e) {
            getLogger().error("Cannot open private MailRepository");
            throw e;
        }
----
What is "open()" ?
MailRepository does not have an open method.

Sorry, just pseudo code. open() creates the the mailbox structure on disk. It's like "lazy loading". This can't happen in initialize method because that gets called on James start up

Joachim

Imho you can do this in the initialize. The call made by James.init at startup can be considered a bug and you can add a workaround for the moment to avoid it.

Stefano


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

Reply via email to