Github user geomacy commented on the issue:
https://github.com/apache/brooklyn-server/pull/155
I have pulled this and was doing some tests around it. I noticed that
given the test YAML
```
services:
- type: org.apache.brooklyn.core.test.entity.TestEntity
id: entity1
brooklyn.config:
test.confName: $brooklyn:component("entity1").effector("myEffector")
```
and a test that does a getConfig, which should evaluate the DSL and invoke
the effector:
```
Assert.assertNull(testEntity.getConfig(TestEntity.CONF_NAME));
```
the expectation is that the call history on the test entity should contain
one call to âmyEffectorâ. In fact it contains two, because the config item
is evaluated during validation in construction of the entity, in a task kicked
of from stack trace
```
"main@1" prio=5 tid=0x1 nid=NA runnable
java.lang.Thread.State: RUNNABLE
at
org.apache.brooklyn.util.core.task.ValueResolver.getMaybeInternal(ValueResolver.java:326)
at
org.apache.brooklyn.util.core.task.ValueResolver.getMaybe(ValueResolver.java:257)
at
org.apache.brooklyn.util.core.task.ValueResolver.get(ValueResolver.java:250)
at
org.apache.brooklyn.core.objs.AbstractConfigurationSupportInternal.getNonBlocking(AbstractConfigurationSupportInternal.java:68)
at
org.apache.brooklyn.core.config.ConfigConstraints.validateAll(ConfigConstraints.java:126)
at
org.apache.brooklyn.core.config.ConfigConstraints.getViolations(ConfigConstraints.java:115)
at
org.apache.brooklyn.core.config.ConfigConstraints.assertValid(ConfigConstraints.java:60)
at
org.apache.brooklyn.core.objs.proxy.InternalEntityFactory.validateDescendantConfig(InternalEntityFactory.java:288)
at
org.apache.brooklyn.core.objs.proxy.InternalEntityFactory.initEntityAndDescendants(InternalEntityFactory.java:306)
at
org.apache.brooklyn.core.objs.proxy.InternalEntityFactory.createEntity(InternalEntityFactory.java:188)
at
org.apache.brooklyn.core.mgmt.internal.LocalEntityManager.createEntity(LocalEntityManager.java:145)
at
org.apache.brooklyn.camp.brooklyn.AbstractYamlTest.createAndStartApplication(AbstractYamlTest.java:128)
at
org.apache.brooklyn.camp.brooklyn.AbstractYamlTest.createAndStartApplication(AbstractYamlTest.java:123)
at
org.apache.brooklyn.camp.brooklyn.AbstractYamlTest.createAndStartApplication(AbstractYamlTest.java:115)
at
org.apache.brooklyn.camp.brooklyn.EffectorsYamlTest.testWithAppEnricher(EffectorsYamlTest.java:39)
```
I've been looking at updating the ValueResolver to be a bit smarter about
this but need to do a bit more testing on it before doing a PR.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---