brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alasdair Hodge <alasdair.ho...@cloudsoftcorp.com>
Subject Re: Adding children dynamically within an effector
Date Wed, 14 Jan 2015 16:44:24 GMT
Thanks Alex, this was the culprit.

Annoying, as I *knew* to do this from previous projects, but it slipped 
my mind nonetheless. Would definitely be in favour of managing new 
children automatically if the parent is already managed.

A.

On 14/01/2015 15:53, Alex Heneveld wrote:
>
> alasdair-
>
> this happens if the child was never managed
>
> this snippet from EntityManagementUtils.java should make it clear:
>
>                  Entity child = (Entity)parent.addChild(spec);
>                  Entities.manage(child);
>                  children.add(child);
>
> this is a part of the model i've never really liked ... are there any
> use cases which would break if we said Entity.addChild automatically
> manages the child if the parent is managed?
>
> --a
>
>
> On 14/01/2015 15:34, Alasdair Hodge wrote:
>> Devs,
>>
>> I have a simple entity that acts a bit like a cluster, with an
>> effector that can dynamically add /n/ more child entities (of a known,
>> fixed type). The effector simply invokes addChild() with a configured
>> EntitySpec in the usual way, synchronously. The resulting Brooklyn
>> task completes normally, according to the activity view, but there's
>> no sign of the new child entities.
>>
>> Manually refreshing the web UI reveals:
>>
>>
>>
>> The 'loading' placeholders are never replaced by actual entities.
>>
>> Any pointers?
>> A.
>> --
>> Alasdair Hodge
>> Principal Engineer,
>> Cloudsoft Corporation

Mime
View raw message