Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 59428 invoked from network); 18 Jun 2007 12:54:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2007 12:54:55 -0000 Received: (qmail 74572 invoked by uid 500); 18 Jun 2007 12:54:58 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 74336 invoked by uid 500); 18 Jun 2007 12:54:57 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 74327 invoked by uid 99); 18 Jun 2007 12:54:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 05:54:57 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rajinisivaram@googlemail.com designates 64.233.166.180 as permitted sender) Received: from [64.233.166.180] (HELO py-out-1112.google.com) (64.233.166.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2007 05:54:52 -0700 Received: by py-out-1112.google.com with SMTP id u77so3178385pyb for ; Mon, 18 Jun 2007 05:54:31 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=i28DZiBaW4GGsyuHIvNZUokhZSbSzRCPXyyLkv/2yR9ggfI9ylVvq1abhMz2oow/wFXK51PwxcJ6XtkDAGz3gUYTGgXIXlQSOFMGkgW4WesNePIHXei8kGUxUTWuxpT5WUzO+FjnZERLiIalQjoiwj+p2yGekimIjQ0Ua1rQEOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TOh6/njvYrDlL7KISDm7Qoy/jwGOQq+x5KW4qby4XIjyfBdf2oZc5QU7WKAtKLL3EYTX1bMhDC5nbQmO2on59YhXwQ0PYOAJnCuwNGE/q2CJY2aNwHTsMKd3UFOCvDfOgkZ0eZhLHo2IWALkgwh2Tmvs42l50a7HqQNBXinTau0= Received: by 10.64.251.9 with SMTP id y9mr9329406qbh.1182171271323; Mon, 18 Jun 2007 05:54:31 -0700 (PDT) Received: by 10.64.193.11 with HTTP; Mon, 18 Jun 2007 05:54:31 -0700 (PDT) Message-ID: Date: Mon, 18 Jun 2007 13:54:31 +0100 From: "Rajini Sivaram" To: dev@felix.apache.org Subject: Re: Implementation of ServiceReference.isAssignableTo different in various OSGi framework implementations In-Reply-To: <46767955.5030704@ungoverned.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20246_28536846.1182171271291" References: <4672D751.7090809@ungoverned.org> <46767955.5030704@ungoverned.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_20246_28536846.1182171271291 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Richard, Yes, you are right. With DS, the bundle wont have access to the class, so the first test wont cause the same problem. If you do put the fix in, when will it be available in a Felix release? Is there a new release planned soon? Thank you... Regards, Rajini On 6/18/07, Richard S. Hall wrote: > > Rajini Sivaram wrote: > > Thank you, Richard. The fix will be of great help to me. > > > > I imagine that the first check will need to be removed to support > delayed > > services with Declarative Services for Felix since presumably DS also > > installs proxy services in order to implement delayed services. > > Proxies are not needed in DS because it can just use the ServiceFactory > interface... > > Even then, it seems that your scenario is only relevant if the registrar > also has access to the same class of the provider's service object, > right? In general, DS, for example, would not have access to any service > object interfaces so the first check would always fail and the second > test would be used. At least, that is my understanding. > > I haven't committed the changes yet, but I should be the end of the day, > I imagine...I just want to think about it a little bit more before doing > so... > > Thanks again. > > -> richard > > > > > Thank you... > > > > Regards, > > > > Rajini > > > > > > On 6/15/07, Richard S. Hall wrote: > >> > >> Rajini Sivaram wrote: > >> > Hello, > >> > > >> > I am working on SCA-OSGi integration to enable OSGi bundles to form > >> the > >> > implementation type for Apache Tuscany SCA components. I have run > into > >> > some > >> > problems because of the way service references are filtered in Felix. > >> > > >> > This is the scenario. We startup Felix runtime in embedded mode > inside > >> > Tuscany. To intercept an OSGi service, a proxy is registered into the > >> > OSGi > >> > service registry. The interface used by the proxy is of the same > >> > classloader > >> > as the one seen by the requestor bundle (it was loaded using > >> > requestorBundle.loadClass). The classloader of the system bundle > >> > however has > >> > access to this interface loaded by the application classloader. The > >> > requestor has a wire for the interface, but the provider (system > >> bundle) > >> > doesn't. The test performed for ServiceReference.isAssignableTo seems > >> > to be > >> > different for Equinox, Knopflerfish and Felix. In both Equinox and > >> > Knopflerfish, the proxy service is returned to the requestor bundle > >> when > >> > getServiceReference is called. Felix, however first tests if the > class > >> > loaded by the provider is the same as the class loaded by the > >> requestor > >> ( > >> > ServiceRegistrationImpl.isClassAccessible()). If the class cannot be > >> > loaded > >> > by the provider, then the class of the registered object is tested. > Is > >> > the > >> > first test which prevents bundles from registering services of > objects > >> > using > >> > different classloaders strictly necessary? Wouldn't it be sufficient > >> > to test > >> > the class of the object registered? > >> > >> Yes, you could be right, because if the service object class is loaded > >> from the provider, then it should be discovered by the second check > >> anyway, right? Thus, it seems like it should only be necessary to do > the > >> second check which will cover both cases...I think... :-) > >> > >> Anyone want to venture a guess as to whether my logic is correct? If > so, > >> I can commit a fix... > >> > >> -> richard > >> > >> > > > ------=_Part_20246_28536846.1182171271291--