Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/911#discussion_r39989056
--- Diff: api/src/main/java/org/apache/brooklyn/api/entity/Entity.java ---
@@ -314,4 +361,80 @@
*/
<T> void emit(Sensor<T> sensor, T value);
}
+
+ @Beta
+ public interface PolicySupport {
+ /**
+ * @return an immutable thread-safe view of the policies.
+ */
+ Collection<Policy> getPolicies();
--- End diff --
Do you mean `public interface PolicySupport extends Iterable<Policy>`? I'd
prefer not for a couple of reasons. First if you wrote `entity.policy().` the
auto-complete would mix the addPolicy/removePolicy with the other methods on
Iterable. Second, the intent is consistency for things on the Entity api - for
`config()`, `sensor()` and `subscriptions()` they don't return Iterable so I'm
inclined to not have policies/enrichers return an iterable either.
---
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.
---