I recognize I'm not answering your questions about the SPI directly with
this reply.

I'm curious what the class creation behavior in your app is like.  If it's
something that you're doing within a factory class (which itself, by nature,
knows about creational logic), then you could palatably proxy ctr-based
injection therein.  This is something you could do by use of manual
instantiation of the injected dependencies through use of the Injector and
introspection (or otherwise knowledge) of the Keys of the ctr arguments.
 I've done this when using cglib to create dynamic subclasses, which I've
instantiated through means of simple ctr-based reflection after
introspecting the superclass constructor to create Keys corresponding to its
parameters and then and to obtain the corresponding values using an
Injector.

-Fred

On Tue, Nov 30, 2010 at 12:02 PM, Simone Tripodi
<[email protected]>wrote:

> Hi all guys,
> after tried creating classes with ASM that require dependency
> injection by Guice, without success, due to Issue 574[1], I' d like to
> know if is there a way to simulate injection points for components
> defined at runtime.
>
> I started taking a look to
> `com.google.inject.spi.ProviderWithDependencies` that requires
> `Set<com.google.inject.spi.Dependency<?>> getDependencies()` method be
> implemented, and the Set can be obtained by invoking
>
> `com.google.inject.spi.Dependency.forInjectionPoints(Set<com.google.inject.spi.InjectionPoint>
> injectionPoints)`.
>
> My trouble is that `com.google.inject.spi.InjectionPoint` instances
> can be build only via `com.google.inject.spi.InjectionPoint` static
> methods, that look for Guice's annotations. Moreover
> `com.google.inject.spi.InjectionPoint` is final so I can't extend it
> to cheat Guice invoking my custom methods. That's the point I'm
> blocked :P
>
> Any thought/suggestion? Many thanks in advance!
> Simo
>
> [1] http://code.google.com/p/google-guice/issues/detail?id=574
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
> --
> 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]<google-guice%[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.

Reply via email to