Re: Inject all service implementations using Tapestry IoC

2012-08-15 Thread Norman Franke
I'll post that as a separate thread to make it easier to find later. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Aug 9, 2012, at 2:08 PM, Dmitry Gusev wrote: > Hello, Norman! > > Sure, I'd like to see your approach. > > On Thu, Aug 9, 2012 at 10:02 PM, Norman Franke

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Dmitry Gusev
Hello, Robert! This looks like what I need! Now I can remove bind() calls and just do: @Contribute(WorkerManager.class) public static void defineWorkers(Configuration conf) { conf.addInstance(GitPullWorker.class); conf.addInstance(GitCloneWorker.class); } And I e

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Dmitry Gusev
Hello, Norman! Sure, I'd like to see your approach. On Thu, Aug 9, 2012 at 10:02 PM, Norman Franke wrote: > If all the workers are in the same package you could make/Google a > PackageEnumerator class that uses a ClassLoader to get all of the classes > in the package, and then register those. I

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Robert Zeigler
Hi Dimitry. What you need is to contribute your workers to the worker manager. Something like: contributeWorkerManager(Configuration conf) { conf.add(...) conf.add(...) } Now, the useful thing about this is that any module that is used in your app that has a "contributeWorkerManager" will

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Norman Franke
If all the workers are in the same package you could make/Google a PackageEnumerator class that uses a ClassLoader to get all of the classes in the package, and then register those. I do this with my DAOs interface and implementations to keep me from having to remember to add them to the AppModu

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Dmitry Gusev
Yes, thanks for correction. But you get the idea? How can I fix the signature to get all the implementations? On Thu, Aug 9, 2012 at 9:52 PM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Thu, 09 Aug 2012 14:38:25 -0300, Dmitry Gusev > wrote: > > Hi, >> > > Hi! > > > But I'd

Re: Inject all service implementations using Tapestry IoC

2012-08-09 Thread Thiago H de Paula Figueiredo
On Thu, 09 Aug 2012 14:38:25 -0300, Dmitry Gusev wrote: Hi, Hi! But I'd like to inject them all at once like this: public static WorkerManager buildWorkerManager(Collection workers) { This isn't dependency injection, it's receiving distributed configuration, hence the empty colle