Re: Manually injecting dependencies after construction

2012-08-13 Thread Inge Solvoll
Thanks for helping me so quickly! :) As always :) I guess I would have to try to implement a service that does this then. A service that looks kind of like this: public interface SetterInjector { void injectInto(Object instance); } And an implementation like this: public class SetterInjectorI

Re: Manually injecting dependencies after construction

2012-08-13 Thread Thiago H de Paula Figueiredo
On Mon, 13 Aug 2012 09:45:49 -0300, Thiago H de Paula Figueiredo wrote: Good question . . . Well, for part of it, you can inject ObjectLocator and use its getService() methods to get a service from the Tapestry-IoC registry. The setter part looks like something that some reflection code

Re: Manually injecting dependencies after construction

2012-08-13 Thread Thiago H de Paula Figueiredo
On Mon, 13 Aug 2012 09:31:55 -0300, Inge Solvoll wrote: So there doesn't exist an exposed API in tapestry for finding setters that match services by type and invoke them runtime on non-tapestry-managed instances? Good question . . . Well, for part of it, you can inject ObjectLocator and

Re: Manually injecting dependencies after construction

2012-08-13 Thread Inge Solvoll
That might work in some cases yes. The case I'm looking at right now is a service that returns a list of objects, where the objects are produced by some other framework on the fly. So I need to inject dependencies into these objects before returning them from my service method. Some code: public

Re: Manually injecting dependencies after construction

2012-08-13 Thread Thiago H de Paula Figueiredo
On Mon, 13 Aug 2012 09:13:50 -0300, Inge Solvoll wrote: Hi! Hi! Why don't you declare these objects as Tapestry-IoC services using a build method in your module class? SomeClass buildSomeClass(Dependency1 dependency1, Dependency2 dependency2) { SomeClass object = ...; // get