When doing the test fixing I came around a bug (or perhaps not) that manifests
itself with Rickards new implementation.
You quite often find a construct like this.
public interface HelloWorldConfiguration extends EntityComposite
{
Property<String> phrase();
Property<String> name();
}
The problem at resolution time manifests itself in the former case that the
Service that uses the configuration.
public static class HelloWorldMixin
implements HelloWorld, Activatable
{
@This
Configuration<HelloWorldConfiguration> config;
....
}
So, because of the EntityComposite that is already implemented by the
HWConfiguration interface the Service also must
implement all Interfaces or have at least mixins for the interfaces needed by
EntityComposite.
(The problem here being Lifecycle).
org.qi4j.spi.composite.InvalidCompositeException: No implementation found for
method public abstract void
org.qi4j.entity.Lifecycle.remove() in
org.qi4j.service.ConfigurationTest$HelloWorldService
at
org.qi4j.runtime.composite.AbstractMixinsModel.implementMethod(AbstractMixinsModel.java:71)
at
org.qi4j.runtime.composite.CompositeMethodsModel.implementMixinType(CompositeMethodsModel.java:88)
at
org.qi4j.runtime.composite.CompositeModel.implementMixinType(CompositeModel.java:252)
at
org.qi4j.runtime.composite.MixinsModel.implementThisUsing(MixinsModel.java:44)
at
org.qi4j.runtime.composite.CompositeModel.<init>(CompositeModel.java:129)
at
org.qi4j.runtime.composite.CompositeModel.newModel(CompositeModel.java:75)
at
org.qi4j.bootstrap.ModuleAssembly.assembleModule(ModuleAssembly.java:235)
at
org.qi4j.bootstrap.ApplicationFactory.newApplication(ApplicationFactory.java:110)
at
org.qi4j.bootstrap.ApplicationFactory.newApplication(ApplicationFactory.java:86)
at
org.qi4j.bootstrap.ApplicationFactory.newApplication(ApplicationFactory.java:53)
If one instead uses the separated interface + composition interface it all
works fine because the HWConfiguration
interface has no dependencies to any other Mixin-Interface.
public interface HelloWorldConfiguration
{
Property<String> phrase();
Property<String> name();
}
public interface HelloWorldConfigurationComposite
extends HelloWorldConfiguration, EntityComposite
{
}
Is this intended or should we create a way to keep the shortcut (this is mostly
used with Configuration, simple
Composites and the like (joining the domain interface and the mixin
specification).
I found this in different tests. Perhaps this also exists in sample
applications.
Michael
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev