While using
my own symbol source implementations, I figured out
that it is not possible to do somthing like this:
that it is not possible to do somthing like this:
<service-point id="SymbolSourceTest"
interface="symbolsource.StringHolder">
<invoke-factory>
<construct class="symbolsource.StringHolder">
<string>${A}</string>
</construct>
</invoke-factory>
</service-point>
<invoke-factory>
<construct class="symbolsource.StringHolder">
<string>${A}</string>
</construct>
</invoke-factory>
</service-point>
<contribution
configuration-id="hivemind.ApplicationDefaults">
<default symbol="A" value="${B} and more"/>
</contribution>
<default symbol="A" value="${B} and more"/>
</contribution>
<contribution
configuration-id="hivemind.ApplicationDefaults">
<default symbol="B" value="C"/>
</contribution>
<default symbol="B" value="C"/>
</contribution>
There is a
chain of links (no cycle): ${A} -> ${B} -> C
Accessing the SymbolSourecTest service results in an:
....
Caused by: org.apache.hivemind.ApplicationRuntimeException: A recursive call to construct configuration hivemind.ApplicationDefaults has occured. This indicates a cycle between one or more configurations or services.
at org.apache.hivemind.impl.ConfigurationPointImpl.constructElements(ConfigurationPointImpl.java:180)
at org.apache.hivemind.impl.ElementsInnerProxyList.inner(ElementsInnerProxyList.java:46)
at org.apache.hivemind.impl.ElementsInnerProxyList.size(ElementsInnerProxyList.java:62)
at org.apache.hivemind.impl.ElementsProxyList.size(ElementsProxyList.java:60)
at org.apache.hivemind.service.impl.DefaultsSymbolSource.initializeService(DefaultsSymbolSource.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.findAndInvokeInitializerMethod(BuilderFactoryLogic.java:275)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.invokeInitializer(BuilderFactoryLogic.java:249)
... 104 more
Accessing the SymbolSourecTest service results in an:
....
Caused by: org.apache.hivemind.ApplicationRuntimeException: A recursive call to construct configuration hivemind.ApplicationDefaults has occured. This indicates a cycle between one or more configurations or services.
at org.apache.hivemind.impl.ConfigurationPointImpl.constructElements(ConfigurationPointImpl.java:180)
at org.apache.hivemind.impl.ElementsInnerProxyList.inner(ElementsInnerProxyList.java:46)
at org.apache.hivemind.impl.ElementsInnerProxyList.size(ElementsInnerProxyList.java:62)
at org.apache.hivemind.impl.ElementsProxyList.size(ElementsProxyList.java:60)
at org.apache.hivemind.service.impl.DefaultsSymbolSource.initializeService(DefaultsSymbolSource.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.findAndInvokeInitializerMethod(BuilderFactoryLogic.java:275)
at org.apache.hivemind.service.impl.BuilderFactoryLogic.invokeInitializer(BuilderFactoryLogic.java:249)
... 104 more
However, if
you use another SymbolSource which resolves the ${B} from
another
contribution than it works, because two different SymbolSource-Services are used.
contribution than it works, because two different SymbolSource-Services are used.
Is it
possible to change construction of symbol sources such that no
creation cycles occur?
Stefan
