lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: best practice to introducing singletons inside of Solr (IoC)
Date Wed, 28 Dec 2011 13:48:13 GMT
I must be missing something here. Why would this be any different from
any other singleton? I just did a little experiment where I implemented
the classic singleton pattern in a RequestHandler and accessed
from a Filter (both plugins) with no problem at all, just the usual
blah var = MySingleton.getInstance();
var.whatever....

There was non need to get Solr cores involved at all. Of course this
was just a simple experiment, YMMV..

Best
Erick

On Tue, Dec 27, 2011 at 11:52 PM, Mikhail Khludnev
<mkhludnev@griddynamics.com> wrote:
> Colleagues,
>
> Don't hesitate to emit your opinion. Please!
>
> Regards
>
> On Wed, Dec 21, 2011 at 11:06 PM, Mikhail Khludnev <
> mkhludnev@griddynamics.com> wrote:
>
>> Hello,
>>
>> I need to introduce several singletons inside of Solr and make them
>> available for my own SearchHandlers, Components, and even QParsers, etc.
>>
>> Right now I use some kind of fake SolrRequestHandler which loads on init()
>> and available everywhere through
>> solrCore.getRequestHandler("wellknownName"). Then I downcast it everywhere
>> and access the required methods. The same is possible with fake
>> SearchComponent.
>> Particularly my singletons are some additional fields schema (pretty
>> sophisticated), and kind of request/response encoding facility.
>> The typical Java hammer for such pins is Spring, but I've found puzzling
>> to use
>> http://static.springframework.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/context/support/WebApplicationContextUtils.html
>>
>> What's the best way to do that?
>>
>> --
>> Sincerely yours
>> Mikhail Khludnev
>> Lucid Certified
>> Apache Lucene/Solr Developer
>> Grid Dynamics
>>
>> <http://www.griddynamics.com>
>>  <mkhludnev@griddynamics.com>
>>
>>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Lucid Certified
> Apache Lucene/Solr Developer
> Grid Dynamics
>
> <http://www.griddynamics.com>
>  <mkhludnev@griddynamics.com>

Mime
View raw message