> You can write an Avalon block, and then get a handle on the spool
> repository; take a look at JamesSpoolManager.initialize(). Problem is,
> this block would be one of the James blocks, so that the class wouldn't be
> quite external.
>
> Oki

A nice n easy solution which allows me to use whatever repository is best,
including mbox files, but...

    public void setComponentManager(ComponentManager comp) {
        this.comp = new SimpleComponentManager(comp);
    }

    public void init() throws Exception {

        logger = (Logger) comp.getComponent(Interfaces.LOGGER);
        logger.log("JamesSpoolManager init...", "Processor", logger.INFO);
        spool = (SpoolRepository) comp.getComponent(Constants.SPOOL_REPOSITORY);
        mailetcontext = (MailetContext)
comp.getComponent(Interfaces.MAIL_SERVER);

...I still need a way to get a handle to comp.

A really easy way to get a handle to the James.comp object is to subclass the
James class, have the conf file instantiate my subclass, and use my derived
class when I need to see the handle.  In James.java the comp variable is
private, so is there an objection to either making it protected or adding an
accessor method getComponentManager()?

The JDBC solution is not bad at all, but a solution that lets me use non-JDBC
repositories is better.  This solution lets me use any kind of repository.
(n.b.: it's ok if my code is in the same JVM as James.)

- Lucas


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

Reply via email to