hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Mattox" <mich...@verideon.com>
Subject RE: Example of HiveMind constructor injection
Date Thu, 23 Jun 2005 09:16:47 GMT
> http://jakarta.apache.org/hivemind/hivemind/BuilderFactory.html#Constructor+
> Parameter+Elements
>
> So, in your example, I would imagine that it's...
>
> <construct class="hivemindtest.di.MyServiceImpl">
>   <configuration>Simple</configuration>
> </construct>

Thanks for the help, I got my simple example working.  Now I think I have
one more case, slightly more complicated and then I can feel at ease with
using HiveMind for the dependency injection.

I have an object Encryptor which encrypts URLs.  It has a dependency which
is a String encryptionKey.  Now I have two services which use this
Encryptor, and each of them will need to configure the Encryptor with a
different encryption key.

I think it's pretty straightforward to do this if I only use one
encryption key.  But I don't understand how I can configure two instances
of the Encryptor.  This situation comes up a lot in fact, because some of
my services have to be configured with a client id and there are several,
some have a language, etc.  So rather than pass these dependencies as
parameters to each method, I'd like to have an instance of my service for
each case.  For example, an instance for english, an instance for french. 
I hope this makes sense.

If you can tell me how to structure the hivemodule.xml file for this
scenario I'd be very grateful.  Thanks again for everyone's help!

-Michael



--
This E-mail is confidential.  It may also be legally privileged.  If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free.  The sender does not accept liability for any errors or omissions.


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message