You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Da...@L-3Com.com on 2011/08/26 21:32:33 UTC

Declarative Services, determining reference satisfaction with target services

I have a factory component (call it ComponentA) with a service reference
(call it X).  The service reference X has an interface of Y and a target
of "(name=Z)"

 

If a service is registered with an interface of Y, but a name service
property of something other than Z, I would expect the service reference
X to not be satisfied.  However, using Felix SCR, I'm seeing that the
reference is satisfied.  When I go to create an instance with the
factory, I then get a ComponentException saying the dependency is not
satisfied.

 

David Humeniuk

Software Engineer

L-3 Nova Engineering

4393 Digital Way

Mason, Ohio 45040

513-204-7628 (Direct)

513-204-7600 (Main)

513-204-8999 (Main Fax)

www.L-3com.com/Nova

 


RE: Declarative Services, determining reference satisfaction with target services

Posted by Da...@L-3Com.com.
I looked at the issue and see that the fix is undesirable.  Perhaps I
should send something to the OSGi mailing list but it seems like this
issue should be better explained in the specification.

Is there a good way then to check or wait for the component instance to
be satisfied?

David Humeniuk


-----Original Message-----
From: Pierre De Rop [mailto:pierre.derop@gmail.com] 
Sent: Saturday, August 27, 2011 6:23 PM
To: users@felix.apache.org
Subject: Re: Declarative Services, determining reference satisfaction
with target services

David,

I created the FELIX-3090 issue, and attached a patch to it.
can you test it ? thanks.

/pierre

On Sat, Aug 27, 2011 at 11:50 PM, Pierre De Rop
<pi...@gmail.com>wrote:

> Hi David,
>
> Indeed I have also reproduce the problem you are describing.
> I think I have a working patch; so I will create a JIRA issue and will
> attach the patch to it.
>
> kind regards;
> /Pierre
>
>
> On Fri, Aug 26, 2011 at 11:58 PM, <Da...@l-3com.com> wrote:
>
>> It looks like part of the problem is that the ComponentFactoryImpl
>> doesn't look at the target service properties for some reason so it
>> accepts services even if the target doesn't match.  When the
component
>> instance is created, the ComponentFactoryNewInstance does check the
>> target properties so the instantiation fails.
>>
>> I think this is a bug.
>>
>> David Humeniuk
>>
>> -----Original Message-----
>> From: David.Humeniuk@L-3Com.com [mailto:David.Humeniuk@L-3Com.com]
>> Sent: Friday, August 26, 2011 3:33 PM
>> To: users@felix.apache.org
>> Subject: Declarative Services, determining reference satisfaction
with
>> target services
>>
>> I have a factory component (call it ComponentA) with a service
reference
>> (call it X).  The service reference X has an interface of Y and a
target
>> of "(name=Z)"
>>
>>
>>
>> If a service is registered with an interface of Y, but a name service
>> property of something other than Z, I would expect the service
reference
>> X to not be satisfied.  However, using Felix SCR, I'm seeing that the
>> reference is satisfied.  When I go to create an instance with the
>> factory, I then get a ComponentException saying the dependency is not
>> satisfied.
>>
>>
>>
>> David Humeniuk
>>
>> Software Engineer
>>
>> L-3 Nova Engineering
>>
>> 4393 Digital Way
>>
>> Mason, Ohio 45040
>>
>> 513-204-7628 (Direct)
>>
>> 513-204-7600 (Main)
>>
>> 513-204-8999 (Main Fax)
>>
>> www.L-3com.com/Nova
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>

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


Re: Declarative Services, determining reference satisfaction with target services

Posted by Pierre De Rop <pi...@gmail.com>.
David,

I created the FELIX-3090 issue, and attached a patch to it.
can you test it ? thanks.

/pierre

On Sat, Aug 27, 2011 at 11:50 PM, Pierre De Rop <pi...@gmail.com>wrote:

> Hi David,
>
> Indeed I have also reproduce the problem you are describing.
> I think I have a working patch; so I will create a JIRA issue and will
> attach the patch to it.
>
> kind regards;
> /Pierre
>
>
> On Fri, Aug 26, 2011 at 11:58 PM, <Da...@l-3com.com> wrote:
>
>> It looks like part of the problem is that the ComponentFactoryImpl
>> doesn't look at the target service properties for some reason so it
>> accepts services even if the target doesn't match.  When the component
>> instance is created, the ComponentFactoryNewInstance does check the
>> target properties so the instantiation fails.
>>
>> I think this is a bug.
>>
>> David Humeniuk
>>
>> -----Original Message-----
>> From: David.Humeniuk@L-3Com.com [mailto:David.Humeniuk@L-3Com.com]
>> Sent: Friday, August 26, 2011 3:33 PM
>> To: users@felix.apache.org
>> Subject: Declarative Services, determining reference satisfaction with
>> target services
>>
>> I have a factory component (call it ComponentA) with a service reference
>> (call it X).  The service reference X has an interface of Y and a target
>> of "(name=Z)"
>>
>>
>>
>> If a service is registered with an interface of Y, but a name service
>> property of something other than Z, I would expect the service reference
>> X to not be satisfied.  However, using Felix SCR, I'm seeing that the
>> reference is satisfied.  When I go to create an instance with the
>> factory, I then get a ComponentException saying the dependency is not
>> satisfied.
>>
>>
>>
>> David Humeniuk
>>
>> Software Engineer
>>
>> L-3 Nova Engineering
>>
>> 4393 Digital Way
>>
>> Mason, Ohio 45040
>>
>> 513-204-7628 (Direct)
>>
>> 513-204-7600 (Main)
>>
>> 513-204-8999 (Main Fax)
>>
>> www.L-3com.com/Nova
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>

Re: Declarative Services, determining reference satisfaction with target services

Posted by Pierre De Rop <pi...@gmail.com>.
Hi David,

Indeed I have also reproduce the problem you are describing.
I think I have a working patch; so I will create a JIRA issue and will
attach the patch to it.

kind regards;
/Pierre

On Fri, Aug 26, 2011 at 11:58 PM, <Da...@l-3com.com> wrote:

> It looks like part of the problem is that the ComponentFactoryImpl
> doesn't look at the target service properties for some reason so it
> accepts services even if the target doesn't match.  When the component
> instance is created, the ComponentFactoryNewInstance does check the
> target properties so the instantiation fails.
>
> I think this is a bug.
>
> David Humeniuk
>
> -----Original Message-----
> From: David.Humeniuk@L-3Com.com [mailto:David.Humeniuk@L-3Com.com]
> Sent: Friday, August 26, 2011 3:33 PM
> To: users@felix.apache.org
> Subject: Declarative Services, determining reference satisfaction with
> target services
>
> I have a factory component (call it ComponentA) with a service reference
> (call it X).  The service reference X has an interface of Y and a target
> of "(name=Z)"
>
>
>
> If a service is registered with an interface of Y, but a name service
> property of something other than Z, I would expect the service reference
> X to not be satisfied.  However, using Felix SCR, I'm seeing that the
> reference is satisfied.  When I go to create an instance with the
> factory, I then get a ComponentException saying the dependency is not
> satisfied.
>
>
>
> David Humeniuk
>
> Software Engineer
>
> L-3 Nova Engineering
>
> 4393 Digital Way
>
> Mason, Ohio 45040
>
> 513-204-7628 (Direct)
>
> 513-204-7600 (Main)
>
> 513-204-8999 (Main Fax)
>
> www.L-3com.com/Nova
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

RE: Declarative Services, determining reference satisfaction with target services

Posted by Da...@L-3Com.com.
It looks like part of the problem is that the ComponentFactoryImpl
doesn't look at the target service properties for some reason so it
accepts services even if the target doesn't match.  When the component
instance is created, the ComponentFactoryNewInstance does check the
target properties so the instantiation fails.

I think this is a bug.

David Humeniuk

-----Original Message-----
From: David.Humeniuk@L-3Com.com [mailto:David.Humeniuk@L-3Com.com] 
Sent: Friday, August 26, 2011 3:33 PM
To: users@felix.apache.org
Subject: Declarative Services, determining reference satisfaction with
target services

I have a factory component (call it ComponentA) with a service reference
(call it X).  The service reference X has an interface of Y and a target
of "(name=Z)"

 

If a service is registered with an interface of Y, but a name service
property of something other than Z, I would expect the service reference
X to not be satisfied.  However, using Felix SCR, I'm seeing that the
reference is satisfied.  When I go to create an instance with the
factory, I then get a ComponentException saying the dependency is not
satisfied.

 

David Humeniuk

Software Engineer

L-3 Nova Engineering

4393 Digital Way

Mason, Ohio 45040

513-204-7628 (Direct)

513-204-7600 (Main)

513-204-8999 (Main Fax)

www.L-3com.com/Nova

 


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