Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sisu-users] The importance of @Named in sisu

So, I have an @Named class (call it Fred) with an @Inject constructor
that called for a Map<String, T> to pick up all the @Named classes of
class T.

Now, this is The Very Class that I obtain from the injector in
bootstrap. I create the injector, and then call
createInstance(Fred.class).

In the process of cleaning something else up, I removed the @Named.

The injection of the Map then failed in Guice -- before Sisu ever got
run to do anything. When I put the @Named back on the class, all was
well.

I'd be grateful for some insight into the principle.


Back to the top