slightly better logging information about error during transformation
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/404b7e02 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/404b7e02 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/404b7e02 Branch: refs/heads/master Commit: 404b7e02b960a86c806d626a206ef7e48711bcba Parents: c3758e0 Author: Alex Heneveld <[email protected]> Authored: Wed Oct 28 11:59:51 2015 +0000 Committer: Alex Heneveld <[email protected]> Committed: Wed Oct 28 11:59:51 2015 +0000 ---------------------------------------------------------------------- .../apache/brooklyn/enricher/stock/AbstractTransformer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/404b7e02/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java index 8a9cf53..5d1fe3e 100644 --- a/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java +++ b/core/src/main/java/org/apache/brooklyn/enricher/stock/AbstractTransformer.java @@ -28,6 +28,7 @@ import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.core.config.ConfigKeys; import org.apache.brooklyn.core.enricher.AbstractEnricher; import org.apache.brooklyn.core.sensor.BasicSensorEvent; +import org.apache.brooklyn.util.javalang.JavaClassNames; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -63,10 +64,9 @@ public abstract class AbstractTransformer<T,U> extends AbstractEnricher implemen this.targetSensor = targetSensorSpecified!=null ? (Sensor<U>) targetSensorSpecified : (Sensor<U>) this.sourceSensor; if (producer.equals(entity) && targetSensorSpecified==null) { // We cannot call getTransformation() here to log the tranformation, as it will attempt - // to resolve the transformation, which will cause the entity initialization thread to - // block + // to resolve the transformation, which will cause the entity initialization thread to block LOG.error("Refusing to add an enricher which reads and publishes on the same sensor: "+ - producer+"."+sourceSensor+" (computing transformation)"); + producer+"."+sourceSensor+" (computing transformation with "+JavaClassNames.simpleClassName(this)+")"); // we don't throw because this error may manifest itself after a lengthy deployment, // and failing it at that point simply because of an enricher is not very pleasant // (at least not until we have good re-run support across the board)
