Ah, that's what I was missing. Knew it was something simple like that. It was
the erasure that was killing things. If I was sub-classing it would have kept
the type information.
Not sure what you mean by "dry" but creating sub-classes for every service
seems like overkill if there is a simple way to reuse code. If you mean DRY, I
think my setup is DRY because I'm not creating empty sub-classes for everything
over and over. I'd just be adding a single line of code to my scheduler to
setup a new Updater.
-bp
On Sep 12, 2010, at 3:33 AM, Alen Vrečko wrote:
>> new InjectableRunnable<Updater<SomeUpdatable>>(injector, new
>> Key<Updater<SomeUpdatable>>() {})
>> However, the runtime types aren't available and I'm getting the usual
>> expcetion:
>
> If you are looking for generics on the InjectableRunnable then you
> forgot to put {} at the end i.e.
>
> new InjectableRunnable<Updater<SomeUpdatable>>(injector, new
> Key<Updater<SomeUpdatable>>() {}){};
>
> The api looks dry. How about each Updatable having an implicit
> "InjectableRunnable" created - just like in Guice each Key has an
> implicit Provider.
>
> .addRecurringTask(SomeUpdatable.class);
>
> Cheers
> Alen
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.