Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/835#discussion_r143085114
--- Diff:
core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java ---
@@ -402,10 +415,21 @@ public void setDisplayName(String name) {
this.name = name;
}
+ @Override
+ public ManagementContext getManagementContext() {
+ ManagementContext result = super.getManagementContext();
+ if (result!=null) return result;
+ if (entity!=null) {
+ return ((EntityInternal)entity).getManagementContext();
+ }
+ return null;
+ }
+
public void setEntity(EntityLocal entity) {
if (destroyed.get()) throw new IllegalStateException("Cannot set
entity on a destroyed entity adjunct");
this.entity = entity;
- this.execution = ((EntityInternal) entity).getExecutionContext();
+ this.execution = new BasicExecutionContext(
getManagementContext().getExecutionManager(),
--- End diff --
yes, that's cleaner
---