Hi Dimitry.
What you need is to contribute your workers to the worker manager. Something
like:
contributeWorkerManager(Configuration<Worker> 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 be called and all of the conf.adds
will be conglomerated into the single collection which will be passed to your
buildWorerManager method.
So the missing piece for you is just the contributeWorkerManager. Or you could
use annotations for better type-safety:
@Contribute(WorkerManager.class)
configWorkerManager(Configuration<Worker> conf) {
...
}
Robert
On Aug 9, 2012, at 8/912:57 PM , Dmitry Gusev wrote
> 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 <
> [email protected]> wrote:
>
>> On Thu, 09 Aug 2012 14:38:25 -0300, Dmitry Gusev <[email protected]>
>> wrote:
>>
>> Hi,
>>>
>>
>> Hi!
>>
>>
>> But I'd like to inject them all at once like this:
>>>
>>> public static WorkerManager buildWorkerManager(Collection<**Worker>
>>> workers) {
>>>
>>
>> This isn't dependency injection, it's receiving distributed configuration,
>> hence the empty collection.
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.**apache.org<[email protected]>
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]