: Ok. Let me try with plain java one. Possibly I'll need more tight : integration like injecting a core into the singleton, etc. But I don't know : yet.
yeah ... it really depends on what you mean by "singleton" ... ...single instance in entire JVM? ...single instance in each webapp? ...single instance in each solr core? If you want the first or the second, standard java patterns will be your best bet, but you'll need to be careful with the classpath and make sure your class is loaded at the appropriate level (and in the first case: can't directly know about any Solr specific classes). If you want one instance per solr core, that is part of the solr core lifecycle (so a new one is created if/when the core is replaced) i think the approach of an explicitly named request handler is simplest way to go. -Hoss