RE: [picocontainer-dev] bug on pico start
Jörg Schaible <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Erik,
Putrycz, Erik wrote on Thursday, August 02, 2007 6:04 PM:
> Thanks Paul, I just redid the patch to be cleaner I unfortulately did
> some formatting on that previous patch.
> I'm basically doing lots of IoC violations... My code is very close
> to what is in the testcase.
>
> In my app I just added a bunch of configuration classes. At
> the start of
> the application, I need to initialize the configuration classes (check
> if directories exist...). I have componentized the configuration into
> modules so in the start (pico.start)) I retrieve all the
> configuration modules by doing
> pico.getComponents(ConfigurationModule.class). And that
> barfs a concurrency exception.
>
> I know propagating the container is outside of schoolbooks of
> IoC but it
> would be nice if pico could accommodate that as well.
Personally, I'd rather change the implementation that Pico detects the situation and throws an IllegalArgumentException when registering a PicoContainer than starting to support this. Since you did not show exactly what you do, I can only assume about your exact use case, but I believe that it can easily fixed with a proper component:
class ConfigurationManager{
ConfigurationManager(ConfigurationModule[] cm) {
// do whatever you have to do with the CMs.
}
}
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email