Greetings,
I got the Datum setter injector working but I cannot get it to work with
constructor injection. My service looks like this:
public class MyServiceImpl implements MyService {
List data;
public MyServiceImpl(List data) {
super();
System.out.println("Constructor called.");
}
and my hivemodule.xml:
<module id="hivemindtest.di" version="1.0.0" package="hivemindtest.di">
<configuration-point id="Simple">
<schema>
<element name="datum">
<attribute name="key" required="true"/>
<attribute name="value" required="true"/>
<conversion class="hivemindtest.di.DatumImpl"/>
</element>
</schema>
</configuration-point>
<contribution configuration-id="Simple">
<datum key="key1" value="value1"/>
<datum key="key2" value="value2"/>
</contribution>
<service-point id="MyService" interface="hivemindtest.di.MyService">
<invoke-factory>
<construct class="hivemindtest.di.MyServiceImpl">
<set-configuration property="data" configuration-id="Simple"/>
</construct>
</invoke-factory>
</service-point>
</module>
When I run I get this:
org.apache.hivemind.ApplicationRuntimeException: Unable to construct
service hivemindtest.di.MyService: Error building service
hivemindtest.di.MyService: Unable to find constructor applicable for
autowiring. Use explicit constructor parameters.
But I have no idea how to "use explicit constructor parameters". I've
read through the documentation and I cannot find anything. I've searched
for the <construct & <set-configuration tags in the module descriptor
documentation but nothing is found. I'm really stuck.
I've used Pico before so I'm familar with the concepts, I just can't seem
to make sense out of the HiveMind documentation. In searching the mailing
list, I am of the impression that the 1.1-beta1 version does not include
everything needed for constructor injection OR the documentation is not up
to date. I found a JIRA issue for example on injecting a single object
instead of a list or map, but I don't know if the patch was accepted (I
don't think so, the issue hasn't been updated). It seems this would be
required for constructor injection, if not all the constructor parameters
would be of type List, which would make a pretty hard to use constructor.
:)
I hope all this makes sense. I'm looking forward to using HiveMind on
this project and I thank you all for your help.
-Michael
--
This E-mail is confidential. It may also be legally privileged. If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free. The sender does not accept liability for any errors or omissions.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]