Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/390#discussion_r85905133
  
    --- Diff: 
camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java
 ---
    @@ -353,6 +386,33 @@ public DslSensorSupplier(DslComponent component, 
Object sensorIndicator) {
             }
     
             @Override
    +        public Maybe<Sensor<?>> getImmediately() {
    +            return getImmediately(sensorName, false);
    +        }
    +        
    +        protected Maybe<Sensor<?>> getImmediately(Object si, boolean 
resolved) {
    +            if (si instanceof Sensor) {
    +                return Maybe.<Sensor<?>>of((Sensor<?>)si);
    +            } else if (si instanceof String) {
    +                Entity targetEntity = component.get();
    +                Sensor<?> result = null;
    +                if (targetEntity!=null) {
    +                    result = 
targetEntity.getEntityType().getSensor((String)si);
    +                }
    +                if (result!=null) return Maybe.<Sensor<?>>of(result);
    +                return Maybe.<Sensor<?>>of(Sensors.newSensor(Object.class, 
(String)si));
    --- End diff --
    
    I see - I'd overlooked the distinction here between getting the sensor 
and/or its value - so this `newSensor(...si)` corresponds to the 
`newSensor(...sensorName)` at line 283, but here we're returning the sensor. 
Got it now.


---
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.
---

Reply via email to