On Thu, 25 Oct 2001 06:59, Serge Knystautas wrote:
> I'm trying to get the DataSourceSelector from the ComponentManager in the
> JAMES component, but it's not offered. It is offered to the
> JDBCMailRepository. So I tried copying the code from the repository into
> James.java, but it doesn't like it...
> datasources = (DataSourceSelector)componentManager.lookup(
> DataSourceSelector.ROLE );
> works in the repository but not in James.java.
>
> I printed out the component manager offerings in a few components (spool
> manager, james, and the repository) and get this...
>
> jdbc repo:
> Components:[org.apache.avalon.cornerstone.services.store.Store][org.apache.
>a valon.cornerstone.services.datasource.DataSourceSelector]
>
> spool mgr:
> Components:[org.apache.mailet.MailetContext][org.apache.avalon.cornerstone.
>s ervices.threads.ThreadManager][org.apache.james.services.MailStore]
>
> james:
> Components:[org.apache.james.services.UsersRepository][org.apache.james.ser
>v ices.MailServer]
>
> Would someone explain to me how these are set and/or how I change these?
> I've tried reading over Avalon docs but am obviously missing something.
> Thanks.
Each block declares that it has a dependency in it's BlockInfo. So look in
JAMES.xinfo and add an extra dependency - something like
<dependency>
<service
name="org.apache.avalon.cornerstone.services.datasource.DataSourceSelector"
version="1.0"/>
</dependency>
This just declares that the block requires that service. Now you have to map
the service instance into james in the assembly.xml file. It should be
something like putting the following under the assembly declaration for James
block.
<provide name="datasource"
role="org.apache.avalon.cornerstone.services.datasource.DataSourceSelector"/>
--
Cheers,
Pete
-----------------------------------------------------------
"Remember, your body is a temple; however, it's also your
dancehall and bowling alley" -- Dharma Montgomery
-----------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]