@Override public Map<AttributeSensor<?>, Object> getAll() { Map<AttributeSensor<?>, Object> result = Maps.newLinkedHashMap(); Map<String, Object> attribs = attributesInternal.asMap(); for (Map.Entry<String,Object> entry : attribs.entrySet()) { AttributeSensor<?> attribKey = (AttributeSensor<?>) entityType.getSensor(entry.getKey()); if (attribKey == null) { // Most likely a race: e.g. persister thread calling getAllAttributes; writer thread // has written attribute value and is in process of calling entityType.addSensorIfAbsent(attribute) // Just use a synthetic AttributeSensor, rather than ignoring value. // TODO If it's not a race, then don't log.warn every time! LOG.warn("When retrieving all attributes of {}, no AttributeSensor for attribute {} (creating synthetic)", AbstractEntity.this, entry.getKey()); attribKey = Sensors.newSensor(Object.class, entry.getKey()); } result.put(attribKey, entry.getValue()); } return result; }