Yeah, that's basically what I do.  My point about being hackish is that if
your module classes need configuration, you need to have that same
configuration available from every call site of InjectorProvider#get()


On Tue, Mar 25, 2014 at 9:55 PM, Patricio Echagüe <[email protected]>wrote:

> It's fine. You can synchronize with a static monitor the creation on the
> injector per worker. That's how I do it.
>
> public class InjectorProvider {
>
> private static Injector injector;
>
> public static Injector get() {
> if (injector == null) {
> synchronized (InjectorProvider.class) {
>  if (injector == null) {
> injector = Guice.createInjector(
> new DAOModule(),
>  new S3Module();
> }
> }
> }
>
> return injector;
> }
>
>
> On Tue, Mar 25, 2014 at 6:24 PM, Adam Lewis <[email protected]> wrote:
>
>>
>> Doesn't Storm 0.9 have a prepare for the worker?
>>>
>>
>> No, I don't think it does, but please point this out if I'm mistaken.  I
>> found the right JIRA issue though:
>> https://issues.apache.org/jira/browse/STORM-126
>>
>> Seems like the patch was well along but hasn't seen any recent activity.
>>
>
>

Reply via email to