james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Fondermann" <bernd.fonderm...@googlemail.com>
Subject Re: Avalon: providing a service to a MailRepository
Date Sat, 23 Sep 2006 10:42:16 GMT
:-)  the verbosity and bureaucracy demanded by phoenix is much higher
and in large parts inappropriate (to say the least :-) ) compared to
today's IoCs or even directly linking components. I doubt I'd really
like to call it "inversion of control".

The singleton is one solution. But not preferable.
The other is to have a service which is returning (an interface of)
the object you want to pass around. You'd of course still have to bind
your components to that service. But you could make the service return
any implementation of the interface.
Does it help in your scenario or is it complicating things?

  Bernd

On 9/23/06, Joachim Draeger <jdraeger@gmx.de> wrote:
>
> Hi!
>
> At the moment I'm working on a MailRepository wrapper for the MailboxManager API
>   that provides managing and fetching Mailboxes. I try to integrate it with james
> the nice way. :)
> For the implementation (TorqueMailboxManagerProvider) I have the following:
>
> <blockinfo>
>    <block>
>      <version>1.0</version>
>    </block>
>    <services>
>        <service name="org.apache.james.mailboxmanager.MailboxManagerProvider"
> version="1.0" />
>    </services>
> </blockinfo>
>
>
> In assambly.xml I put:
>
> <block name="mailboxmanager"
> class="org.apache.james.mailboxmanager.torque.TorqueMailboxManagerProvider" />
>
> Great! It starts up at James start!
> Now the MailboxManagerMailRepository should lookup the mailboxmanager service...
> Well I noticed that a component can only lookup services that are defined twice,
> in assembly.xml and blockinfo (*.xinfo).
> But how does for example JDBCMailRepository lookup the data-source?
> MailRepositories are instantiated in AvalonMailStore which is proxy-ing the
> services bound to it. Good idea.
> But how do I offer the MailboxManagerProvider to the MailboxManagerMailRepository?
> I bound it to the AvalonMailStore... It worked! I can now look it up.
> I had to modify the AvalonMailStore.xinfo to add the MailboxManagerProvider and
> that is not an option because it requires to rebuild James.
> It should be pluggable!
>
> Well I think I will workaround it and make TorqueMailboxManagerProvider some
> kind of singleton. Am I missing something?
>
> Joachim
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message