Re: felix:persistentFactoryComponent

2023-04-25 Thread David Jencks
Yes, now that you mention it, that is actually seeming like more of the 
motivation for the flag than what I originally recalled. In general I think 
it’s supposed to make the factory-created instances act as much as possible 
like regular components.

David Jencks

> On Apr 25, 2023, at 9:05 AM, Raymond Augé  
> wrote:
> 
> Thanks David, that's great information.
> 
> Let me try to explain what I've witnessed in another way to see if that is
> something you would have expected:
> 
> * When a factory component has a reference, which cannot be _immediately_
> resolved at the moment of activation, it will fail.
> 
> * However, when setting felix:persistentFactoryComponent="true" the
> component behaves as any other component which might have an unresolved
> reference, resulting in deferred activation only upon satisfaction of the
> reference.
> 
> Would you consider that inline with the intent? (I certainly hope so :D
> because that's what I'm looking for.)
> 
> Ray
> 
> On Tue, Apr 25, 2023 at 11:54 AM David Jencks 
> wrote:
> 
>> This is my recollection from the distant past, it could be wrong in
>> several ways.
>> 
>> IIRC if you have a factory component, when you call it to create a
>> component the properties are a mix of the factory component’s properties
>> and the ones you supply.
>> 
>> Furthermore, the spec says if you change the factory component’s
>> properties, all the previously created instances are immediately disposed
>> of. If the manually created component instances are used as dependencies
>> this might not be what you want.
>> 
>> So, IIRC, setting this property changes the behavior when you change the
>> factory properties so the created instances are not automatically disposed
>> of.
>> 
>> I thought I’d documented all the non-standard behaviors I implemented, but
>> this certainly isn’t in the .md.
>> 
>> David Jencks
>> 
>>> On Apr 25, 2023, at 6:56 AM, Raymond Augé 
>> wrote:
>>> 
>>> Hello all,
>>> 
>>> Could someone explain what it means to use
>>> 
>>> felix:persistentFactoryComponent="true"
>>> 
>>> As in:
>>> 
>>> http://www.osgi.org/xmlns/scr/v1.1.0";
>>> 
>>> xmlns:felix="http://felix.apache.org/xmlns/scr/extensions/v1.0.0";>
>>> 
>>> 
>>> >> 
>>> felix:persistentFactoryComponent="true"
>>> 
>>> enabled="false"
>>> 
>>> factory="factory.component.factory" >
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ...
>>> 
>>> --
>>> *Raymond Augé* (@rotty3000)
>>> Senior Software Architect *Liferay, Inc.* (@Liferay)
>>> OSGi Fellow, Java Champion
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
>> For additional commands, e-mail: users-h...@felix.apache.org
>> 
>> 
> 
> -- 
> *Raymond Augé* (@rotty3000)
> Senior Software Architect *Liferay, Inc.* (@Liferay)
> OSGi Fellow, Java Champion


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



Re: felix:persistentFactoryComponent

2023-04-25 Thread Raymond Augé
Thanks David, that's great information.

Let me try to explain what I've witnessed in another way to see if that is
something you would have expected:

* When a factory component has a reference, which cannot be _immediately_
resolved at the moment of activation, it will fail.

* However, when setting felix:persistentFactoryComponent="true" the
component behaves as any other component which might have an unresolved
reference, resulting in deferred activation only upon satisfaction of the
reference.

Would you consider that inline with the intent? (I certainly hope so :D
because that's what I'm looking for.)

Ray

On Tue, Apr 25, 2023 at 11:54 AM David Jencks 
wrote:

> This is my recollection from the distant past, it could be wrong in
> several ways.
>
> IIRC if you have a factory component, when you call it to create a
> component the properties are a mix of the factory component’s properties
> and the ones you supply.
>
> Furthermore, the spec says if you change the factory component’s
> properties, all the previously created instances are immediately disposed
> of. If the manually created component instances are used as dependencies
> this might not be what you want.
>
> So, IIRC, setting this property changes the behavior when you change the
> factory properties so the created instances are not automatically disposed
> of.
>
> I thought I’d documented all the non-standard behaviors I implemented, but
> this certainly isn’t in the .md.
>
> David Jencks
>
> > On Apr 25, 2023, at 6:56 AM, Raymond Augé 
> wrote:
> >
> > Hello all,
> >
> > Could someone explain what it means to use
> >
> > felix:persistentFactoryComponent="true"
> >
> > As in:
> >
> > http://www.osgi.org/xmlns/scr/v1.1.0";
> >
> > xmlns:felix="http://felix.apache.org/xmlns/scr/extensions/v1.0.0";>
> >
> >
> >  >
> > felix:persistentFactoryComponent="true"
> >
> > enabled="false"
> >
> > factory="factory.component.factory" >
> >
> > 
> >
> > 
> >
> > ...
> >
> > --
> > *Raymond Augé* (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* (@Liferay)
> > OSGi Fellow, Java Champion
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
> For additional commands, e-mail: users-h...@felix.apache.org
>
>

-- 
*Raymond Augé* (@rotty3000)
Senior Software Architect *Liferay, Inc.* (@Liferay)
OSGi Fellow, Java Champion


Re: felix:persistentFactoryComponent

2023-04-25 Thread David Jencks
This is my recollection from the distant past, it could be wrong in several 
ways.

IIRC if you have a factory component, when you call it to create a component 
the properties are a mix of the factory component’s properties and the ones you 
supply.

Furthermore, the spec says if you change the factory component’s properties, 
all the previously created instances are immediately disposed of. If the 
manually created component instances are used as dependencies this might not be 
what you want.

So, IIRC, setting this property changes the behavior when you change the 
factory properties so the created instances are not automatically disposed of.

I thought I’d documented all the non-standard behaviors I implemented, but this 
certainly isn’t in the .md.

David Jencks

> On Apr 25, 2023, at 6:56 AM, Raymond Augé  
> wrote:
> 
> Hello all,
> 
> Could someone explain what it means to use
> 
> felix:persistentFactoryComponent="true"
> 
> As in:
> 
> http://www.osgi.org/xmlns/scr/v1.1.0";
> 
> xmlns:felix="http://felix.apache.org/xmlns/scr/extensions/v1.0.0";>
> 
> 
>  
> felix:persistentFactoryComponent="true"
> 
> enabled="false"
> 
> factory="factory.component.factory" >
> 
> 
> 
> 
> 
> ...
> 
> -- 
> *Raymond Augé* (@rotty3000)
> Senior Software Architect *Liferay, Inc.* (@Liferay)
> OSGi Fellow, Java Champion


-
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



felix:persistentFactoryComponent

2023-04-25 Thread Raymond Augé
Hello all,

Could someone explain what it means to use

felix:persistentFactoryComponent="true"

As in:

http://www.osgi.org/xmlns/scr/v1.1.0";

xmlns:felix="http://felix.apache.org/xmlns/scr/extensions/v1.0.0";>








...

-- 
*Raymond Augé* (@rotty3000)
Senior Software Architect *Liferay, Inc.* (@Liferay)
OSGi Fellow, Java Champion