@Override
public <T> void emit(Sensor<T> sensor, T val) {
if (sensor instanceof AttributeSensor) {
LOG.warn("Strongly discouraged use of emit with attribute sensor "+sensor+" "+val+"; use setAttribute instead!",
new Throwable("location of discouraged attribute "+sensor+" emit"));
}
if (val instanceof SensorEvent) {
LOG.warn("Strongly discouraged use of emit with sensor event as value "+sensor+" "+val+"; value should be unpacked!",
new Throwable("location of discouraged event "+sensor+" emit"));
}
BrooklynLogging.log(LOG, BrooklynLogging.levelDebugOrTraceIfReadOnly(AbstractEntity.this),
"Emitting sensor notification {} value {} on {}", sensor.getName(), val, AbstractEntity.this);
emitInternal(sensor, val);
}