[Nutch-dev] Re: Static initializers

2005-12-22 Thread marcel . schnippe
Hi, This is what i did to make NutchConf behave not so static, without patching any of those 195 places Stefan mentioned. NutchConf.get() yields the current config. OpenConf sets a new current config. finally CloseConf closes this config. But be warned about issues with the plugin cache menti

[Nutch-dev] Re: Static initializers

2005-12-21 Thread Stefan Groschupf
Andrzej, well I'm not ready with digging into the problem but want to ask some more questions. BTW I counted 195 places that use NutchConf.get(), so this will be a bigger patch. :) As I mentioned I would love to go the inversion of control way, so not using nutchConf in the constructor but

[Nutch-dev] Re: Static initializers

2005-12-20 Thread Stefan Groschupf
Hi, right this is a know problem and discussed several times, we should start solving this. :-) I suggest that we make the Plugin Class implementing the Configurable interface. In case a plugin needs any configuration value it will request them from the plugin instance. The next step would b

[Nutch-dev] Re: Static initializers

2005-12-20 Thread Andrzej Bialecki
Jérôme Charron wrote: Andrzej, How do you choose the NutchConf to use ? It is provided as an argument to all constructors. Here is a short discussion I had with Doug about a kind of dynamic NutchConf inside the same JVM: "... By looking at the mailing lists archives it seems that having

[Nutch-dev] Re: Static initializers

2005-12-20 Thread Jérôme Charron
Andrzej, How do you choose the NutchConf to use ? Here is a short discussion I had with Doug about a kind of dynamic NutchConf inside the same JVM: "... By looking at the mailing lists archives it seems that having some behavior depending on the documents URL is a recurrent problem (for instance

[Nutch-dev] Re: Static initializers

2005-12-20 Thread Andrzej Bialecki
Andrzej Bialecki wrote: URLFilters: private URLFilters(NutchConf) { // initialize plugins based on this instance of NutchConf } public static URLFilters get(NutchConf conf) { URLFilters res = (URLFilters)conf.get("urlfilters.key"); if (res == null) { res = n