Avalon folks recommended that the each component should have a ROLE
constant. Lookup should be based on that components ROLE rather than
hardcoded class name.
I guess it has been partially followed. I think at some point Paul or Peter
had made a sweep.
Recommendation is to use ROLE, so at least new code should follow it.
Harmeet
----- Original Message -----
From: "Noel J. Bergman" <[EMAIL PROTECTED]>
To: "James-Dev Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 1:28 PM
Subject: ComponentManager.put() vs james-assembly.xml
> Danny,
>
> I am looking at the code, and trying to understand something. In
> James.java, there are some places were we have:
>
> compMgr.put(MailServer.ROLE, this);
>
> A similar call
>
> compMgr.put("org.apache.mailet.MailetContext", this)
>
> is commented out.
>
> JamesSpoolManager gets the MailetContext by looking it up with exactly
that
> string from the component manager, so clearly it is registered. The only
> other reference to the string is in james-assembly, where the
> JamesSpoolManager block has an element that says:
>
> <provide name="James" role="org.apache.mailet.MailetContext"/>
>
> which I understand to say that the entity labeled as James provides the
> MailetContext role to the Spooler.
>
> Is the difference because MailServer.ROLE is looked up by many objects
that
> are not components, and don't have their own block in the assembly file,
> thus there is no other way to specify what object provides that role to
> them?
>
> --- Noel
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>