Hi Knut, Here is the exception I got: org.apache.hivemind.ApplicationRuntimeException: Property connectorContext of object [EMAIL PROTECTED] is read-only
If I write : class CService implements C { private A _a; public A getA() { return _a; } public void setA(A a) { _a = a; } } It works fine. But, If I write: class CService implements C { private A _a; public B getA() { return (B)_a; } public void setA(A a) { _a = a; } } It does not work. HiveWind probably looks first for the getter to descover the property name and type, and find the property "a" typed as "A", and does not find the setter, that's why the exception is "read-only". I wrote it like that because only the setter is needed for service wiring. I did change this ugly stuf to (a more ugly one ?): class CService implements C { private B _b; public B getB() { return _b; } public void setA(A a) { /* check first with instanceof */ _b = (B)a; } } That works fine. I will improve this fuzy design... Thanks a lot for your fast answer. Thibault -----Message d'origine----- De : Knut Wannheden (JIRA) [mailto:[EMAIL PROTECTED] Envoyé : jeudi 16 juin 2005 16:14 À : [EMAIL PROTECTED] Objet : [jira] Commented: (HIVEMIND-132) <set-servive> and interface inheritence [ http://issues.apache.org/jira/browse/HIVEMIND-132?page=comments#action_12313 827 ] Knut Wannheden commented on HIVEMIND-132: ----------------------------------------- Thibault, This should work. I just tried the following which works. public interface A {...} public interface B extends A {...} public class BImpl implements B {...} public interface C {...} public class CImpl implements C { public void setA(A a) {...} ... } <module id="test" version="1.0.0"> <service-point id="B" interface="B"> <create-instance class="BImpl"/> </service-point> <service-point id="C" interface="C"> <invoke-factory> <construct class="CImpl"> <set-service service-id="B" property="a"/> </construct> </invoke-factory> </service-point> </module> Can you please show me the error message you get and the Java source + module descriptor? > <set-servive> and interface inheritence > --------------------------------------- > > Key: HIVEMIND-132 > URL: http://issues.apache.org/jira/browse/HIVEMIND-132 > Project: HiveMind > Type: Bug > Components: framework > Versions: 1.1 > Environment: Windows XP, Hivemind 1.1 beta, JDK 1.4 > Reporter: Thibault Cuvilleir > > Hi ! > => A is not a service interface > Interface A { ...} > => B is a Hivemind service interface > interface B extends A {...} > => BService is a service-id declared in the module desriptor. BService implents B > class BServiceImpl implements B {...} > => CService has a dependance to B, but wants to use the interface A: > class public MyServiceImpl implements C { > private A _otherService; > public void setOtherService(A service) { ... } > } > >>>> Then <set-service service-id="BService" property="otherService> failed. > <set-service> try to match a setter method with the exact service interface (B) and is unable to find a setter method with one of the extended interface (A). > Best regards, > Thibault Cuvillier -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]