Provide meaningful error message when using a custom attribute-controller interface
Given the following adl: <definition name="person"> <content class="PersonImpl" /> <attributes signature="PersonController"> <attribute name="name" value="valerio" /> </attributes> <controller desc="primitive"/> </definition>
If the java interface 'PersonControl' doesn't extends explicitely o.o.f.api.control.AttributeController, we get a ClassCastException, similar to the following:
a.lang.ClassCastException: org.objectweb.fractal.julia.generated.C3901024e_0 at org.objectweb.fractal.util.Fractal.getAttributeController(Fractal.java:127) at org.objectweb.fractal.adl.attributes.FractalAttributeBuilder.setAttribute(FractalAttributeBuilder.java:49) at org.objectweb.fractal.adl.attributes.AttributeCompiler$AttributeTask.execute(AttributeCompiler.java:151) at org.objectweb.deployment.scheduling.core.lib.BasicScheduler.doSchedule(BasicScheduler.java:155) at org.objectweb.deployment.scheduling.core.lib.BasicScheduler.schedule(BasicScheduler.java:178) at org.objectweb.fractal.adl.BasicFactory.newComponent(BasicFactory.java:161)
I think it would be better to throws some other exception (still don't know what to propose here), explaining to the user what he/she should check