Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DD0A7200C14 for ; Tue, 7 Feb 2017 21:05:25 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DBA12160B3E; Tue, 7 Feb 2017 20:05:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 87DBD160B32 for ; Tue, 7 Feb 2017 21:05:24 +0100 (CET) Received: (qmail 55907 invoked by uid 500); 7 Feb 2017 20:05:23 -0000 Mailing-List: contact dev-help@river.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@river.apache.org Delivered-To: mailing list dev@river.apache.org Received: (qmail 55890 invoked by uid 99); 7 Feb 2017 20:05:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 20:05:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1222BC0C5C for ; Tue, 7 Feb 2017 20:05:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.744 X-Spam-Level: *** X-Spam-Status: No, score=3.744 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, MIME_QP_LONG_LINE=0.001, MISSING_MIMEOLE=1.843] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=zeus.net.au Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Gg4ae7z2ezRt for ; Tue, 7 Feb 2017 20:05:17 +0000 (UTC) Received: from server-3t-r60.ipv4.au.syrahost.com (server-3t-r60.ipv4.au.syrahost.com [163.47.72.137]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 1740B5F24B for ; Tue, 7 Feb 2017 20:05:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zeus.net.au ; s=default; h=Content-Type:MIME-Version:Message-ID:To:Subject:From:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wlVDU9xhnMcNtmjeyYtpPWmAjqont9jpLKBbTyD2WV4=; b=NgNFO4DBlKGh1GfiVbRL/zKP1Y 5pJv7bxSoE62IdP7I6mkjXS415IBNBeapcOGf/lKS6zkyboNT8eyEc/qfM1iw7/5QSPm/nMjBU5VE a8QHr10CGTANMENvJ+UPonRqY4EqdXT+NPrk9+AMOS787gwIO4BuNCT63g1CiIMNmY1M=; Received: from pa49-197-12-48.pa.qld.optusnet.com.au ([49.197.12.48]:11102 helo=[10.76.12.9]) by webcloud66.au.syrahost.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1cbC0k-001zL6-EG for dev@river.apache.org; Wed, 08 Feb 2017 04:05:11 +0800 Date: Wed, 8 Feb 2017 06:04:50 +1000 (AEST) From: Peter Subject: Re: OSGi - deserialization remote invocation strategy To: "dev@river.apache.org" Message-ID: <0ae4cb84b37c1f644b8391c0aecf8572@org.tizen.email> MIME-Version: 1.0 Content-Type: MULTIPART/ALTERNATIVE; BOUNDARY="8323328-1148864512-1486497890=:1378" X-Priority: 3 X-MSMail-Priority: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - webcloud66.au.syrahost.com X-AntiAbuse: Original Domain - river.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - zeus.net.au X-Get-Message-Sender-Via: webcloud66.au.syrahost.com: authenticated_id: jini@zeus.net.au X-Authenticated-Sender: webcloud66.au.syrahost.com: jini@zeus.net.au X-Source: X-Source-Args: X-Source-Dir: archived-at: Tue, 07 Feb 2017 20:05:26 -0000 --8323328-1148864512-1486497890=:1378 Content-Type: TEXT/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE In the JGDMS fork of River, in addition to Reggie's proxy returing unmarsha= lled service proxy's from the ServiceRegistrar lookup method, SafeServiceRe= gistrar provides a lookup method that returns instances of java.lang.reflec= t.Proxy that implement interfaces to retrieve the service, it's attributes = and it's codebase uri and signer certs.=0A=0AThe client can authenticate, f= ilter and grant permissions (for deserialization and codebase download) bef= ore retrieving the service proxy using a method call.=0A=0AIn this case the= service proxy is obtained by from the reflection proxy instead of Marshall= edIstance.=0A=0ACheers,=0A=0APeter.=0A=0ASent from my Samsung device.=0A=C2= =A0=0A=C2=A0=C2=A0Include original message=0A---- Original message ----=0AF= rom: "Micha=C5=82 K=C5=82eczek (XPro Sp. z o. o.)" =0ASent: 08/02/2017 05:51:07 am=0ATo: dev@river.apache.org=0ASubject: Re: = OSGi - deserialization remote invocation strategy=0A=0ASo I must have misun= derstood the part about smart proxies being obtained via "reflection proxie= s" or MarshalledInstances.=0A=0AWhat are these "reflection proxies"?=0A=0AThanks,=0AMichal=0A=0APeter wrote:= =0ANo, no bootstrap objects.=0A=0ACheers,=0A=0APeter.=0A=0A=0A=0ASent from = my Samsung device.=0A=C2=A0=0A=C2=A0=C2=A0Include original message=0A---- O= riginal message ----=0AFrom: "Micha=C5=82 K=C5=82eczek (XPro Sp. z o. o.)" = =0ASent: 08/02/2017 12:28:50 am=0ATo: dev@river.ap= ache.org=0ASubject: Re: OSGi - deserialization remote invocation strategy= =0A=0AAre=C2=A0you=C2=A0proposing=C2=A0to=C2=A0provide=C2=A0a=C2=A0bootstra= p=C2=A0object=C2=A0that=C2=A0will=C2=A0download=C2=A0some=C2=A0 =0Ameta=C2= =A0information=C2=A0prior=C2=A0to=C2=A0class=C2=A0resolution? =0A=0AHow=C2= =A0does=C2=A0it=C2=A0differ=C2=A0from=C2=A0simply=C2=A0changing=C2=A0annota= tions=C2=A0to=C2=A0be=C2=A0those=C2=A0 =0A"bootstrap=C2=A0objects"=C2=A0ins= tead=C2=A0of=C2=A0Strings? =0A=0AThanks, =0AMichal =0A=0APeter=C2=A0wrote: = =0A=C2=A0Proposed=C2=A0JERI=C2=A0OSGi=C2=A0class=C2=A0loading=C2=A0strategy= =C2=A0during=C2=A0deserialization. =0A=0A=C2=A0Record=C2=A0caller=C2=A0cont= ext=C2=A0-=C2=A0this=C2=A0is=C2=A0the=C2=A0default=C2=A0bundle=C2=A0at=C2= =A0the=C2=A0beginning=C2=A0of=C2=A0 =0A=C2=A0the=C2=A0stack.=C2=A0=C2=A0It= =C2=A0is=C2=A0obtained=C2=A0by=C2=A0the=C2=A0InvocationHandler=C2=A0on=C2= =A0the =0A=C2=A0client=C2=A0side.=C2=A0=C2=A0The=C2=A0InvocationDispatcher= =C2=A0on=C2=A0the=C2=A0server=C2=A0side=C2=A0has=C2=A0the=C2=A0 =0A=C2=A0ca= lling=C2=A0context=C2=A0of=C2=A0the=C2=A0Remote =0A=C2=A0implementation.=C2=A0=C2=A0The=C2=A0reflection=C2= =A0dynamic=C2=A0proxy=C2=A0must=C2=A0be=C2=A0installed=C2=A0in=C2=A0the=C2= =A0 =0A=C2=A0client's=C2=A0class=C2=A0loader,=C2=A0so=C2=A0the =0A=C2=A0Inv= ocationHandler=C2=A0knows=C2=A0exactly=C2=A0what=C2=A0it=C2=A0is,=C2=A0it= =C2=A0will=C2=A0be=C2=A0passed=C2=A0to=C2=A0the=C2=A0 =0A=C2=A0MarshalInput= Stream.=C2=A0=C2=A0Any =0A=C2=A0interfaces=C2=A0not=C2=A0found=C2=A0in=C2= =A0the=C2=A0client's=C2=A0bundle=C2=A0can=C2=A0be=C2=A0safely=C2=A0shed.=C2= =A0=C2=A0For=C2=A0a=C2=A0 =0A=C2=A0smart=C2=A0proxy=C2=A0the=C2=A0reflectio= n=C2=A0proxy=C2=A0will =0A=C2=A0be=C2=A0installed=C2=A0in=C2=A0the=C2=A0sma= rt=C2=A0proxy=C2=A0loader.=C2=A0=C2=A0The=C2=A0smart=C2=A0proxy=C2=A0is=C2= =A0obtained=C2=A0 =0A=C2=A0either=C2=A0via=C2=A0a=C2=A0reflection=C2=A0prox= y=C2=A0or=C2=A0a=C2=A0MarshalledInstance. =0A=C2=A0MarshalledInstance=C2=A0= also=C2=A0passes=C2=A0in=C2=A0the=C2=A0callers=C2=A0loader=C2=A0to=C2=A0the= =C2=A0 =0A=C2=A0MarshalInputStream. =0A=0A=C2=A0The=C2=A0smart=C2=A0proxy= =C2=A0classloader=C2=A0is=C2=A0not=C2=A0a=C2=A0child=C2=A0loader=C2=A0of=C2= =A0the=C2=A0clients=C2=A0 =0A=C2=A0loader,=C2=A0instead=C2=A0it's=C2=A0a=C2= =A0bundle=C2=A0that=C2=A0imports =0A=C2=A0service=C2=A0api=C2=A0packages,= =C2=A0with=C2=A0a=C2=A0version=C2=A0range=C2=A0that=C2=A0overlaps=C2=A0thos= e=C2=A0already=C2=A0 =0A=C2=A0imported=C2=A0by=C2=A0the=C2=A0client. =0A=0A= =C2=A0Both=C2=A0Invocationhandler=C2=A0and=C2=A0InvocationDispatcher=C2=A0u= tilise=C2=A0 =0A=C2=A0MarshalInputStream=C2=A0and=C2=A0MarshalOutputStream,= =C2=A0for=C2=A0marshalling=C2=A0parameters=C2=A0 =0A=C2=A0and=C2=A0return=C2=A0values. =0A=0A=C2=A0The=C2=A0codeb= ase=C2=A0annotation=C2=A0bundle's=C2=A0manifest=C2=A0contains=C2=A0a=C2=A0l= ist=C2=A0of=C2=A0package=C2=A0 =0A=C2=A0imports. =0A=0A=C2=A0Do=C2=A0we=C2= =A0need=C2=A0to=C2=A0make=C2=A0a=C2=A0list=C2=A0of=C2=A0package=C2=A0import= s=C2=A0for=C2=A0every=C2=A0new=C2=A0bundle=C2=A0that=C2=A0 =0A=C2=A0we=C2= =A0load? =0A=C2=A0Do=C2=A0we=C2=A0need=C2=A0to=C2=A0record=C2=A0the=C2=A0wi= ring=C2=A0and=C2=A0packages=C2=A0and=C2=A0their=C2=A0imports=C2=A0from=C2= =A0 =0A=C2=A0the=C2=A0remote=C2=A0end? =0A=0A=C2=A0I=C2=A0don't=C2=A0think= =C2=A0so,=C2=A0the=C2=A0bundles=C2=A0themselves=C2=A0contain=C2=A0this=C2= =A0information,=C2=A0I=C2=A0 =0A=C2=A0think=C2=A0we=C2=A0just=C2=A0need=C2= =A0to=C2=A0keep=C2=A0the=C2=A0view=C2=A0of=C2=A0available=C2=A0classes=C2= =A0relevant=C2=A0to=C2=A0 =0A=C2=A0the=C2=A0current=C2=A0object=C2=A0being= =C2=A0deserialized. =0A=0A=C2=A0Codebase=C2=A0Annotations=C2=A0are=C2=A0exa= ct=C2=A0versions!=C2=A0=C2=A0They=C2=A0need=C2=A0to=C2=A0be=C2=A0to=C2=A0al= low=C2=A0the=C2=A0 =0A=C2=A0service=C2=A0to=C2=A0ensure=C2=A0the=C2=A0corre= ct=C2=A0proxy=C2=A0codebase=C2=A0is=C2=A0used.=C2=A0=C2=A0Other=C2=A0proxy= =C2=A0 =0A=C2=A0codebases=C2=A0will=C2=A0be=C2=A0installed=C2=A0in=C2=A0the= =C2=A0client,=C2=A0possibly=C2=A0different=C2=A0 =0A=C2=A0versions,=C2=A0bu= t=C2=A0these=C2=A0won't=C2=A0be=C2=A0visible=C2=A0through=C2=A0the=C2=A0res= olved=C2=A0 =0A=C2=A0dependencies,=C2=A0because=C2=A0the=C2=A0proxy=C2=A0co= debases=C2=A0only=C2=A0import=C2=A0packages=C2=A0at=C2=A0the=C2=A0 =0A=C2= =A0client=C2=A0and=C2=A0OSGi=C2=A0restricts=C2=A0visibility=C2=A0to=C2=A0th= e=C2=A0current=C2=A0bundle's=C2=A0own=C2=A0 =0A=C2=A0classes=C2=A0and=C2=A0any=C2=A0imported=C2=A0= packages. =0A=C2=A0Instead=C2=A0of=C2=A0appending=C2=A0dependencies=C2=A0to= =C2=A0the=C2=A0codebase=C2=A0annotation=C2=A0they'll=C2=A0 =0A=C2=A0need=C2= =A0be=C2=A0defined=C2=A0in=C2=A0the=C2=A0proxy's=C2=A0bundle=C2=A0manifest.= =C2=A0=C2=A0Of=C2=A0course=C2=A0if=C2=A0an=C2=A0 =0A=C2=A0identical=C2=A0ve= rsion=C2=A0of=C2=A0a=C2=A0proxy=C2=A0codebase=C2=A0bundle=C2=A0is=C2=A0alre= ady=C2=A0installed=C2=A0at=C2=A0 =0A=C2=A0the=C2=A0client,=C2=A0this=C2=A0w= ill=C2=A0be=C2=A0used=C2=A0again. =0A=0A=C2=A0Because=C2=A0a=C2=A0bundle=C2= =A0generally=C2=A0imports=C2=A0packages=C2=A0(importing=C2=A0entire=C2=A0bu= ndles=C2=A0 =0A=C2=A0is=C2=A0discouraged=C2=A0in=C2=A0OSGi),=C2=A0there=C2= =A0may=C2=A0be=C2=A0classes =0A=C2=A0that=C2=A0aren't=C2=A0visible=C2=A0fro= m=C2=A0those=C2=A0bundles,=C2=A0such=C2=A0as=C2=A0transient=C2=A0imports,= =C2=A0but=C2=A0 =0A=C2=A0also=C2=A0including=C2=A0private=C2=A0packages=C2= =A0that=C2=A0aren't=C2=A0exported,=C2=A0private =0A=C2=A0implementations=C2= =A0need=C2=A0to=C2=A0be=C2=A0deserialized,=C2=A0but=C2=A0is=C2=A0it=C2=A0po= ssible=C2=A0to=C2=A0do=C2=A0so=C2=A0 =0A=C2=A0safely,=C2=A0without=C2=A0cau= sing=C2=A0package =0A=C2=A0conflicts?=C2=A0=C2=A0=C2=A0Private=C2=A0impleme= ntation=C2=A0classes=C2=A0can=C2=A0be=C2=A0used=C2=A0as=C2=A0fields=C2=A0 = =0A=C2=A0within=C2=A0an=C2=A0exported=C2=A0public=C2=A0object,=C2=A0but=C2= =A0cannot=C2=A0and=C2=A0should=C2=A0not =0A=C2=A0escape=C2=A0their=C2=A0pri= vate=C2=A0scope,=C2=A0doing=C2=A0so=C2=A0risks=C2=A0them=C2=A0being=C2=A0re= solved=C2=A0to=C2=A0a=C2=A0 =0A=C2=A0bundle=C2=A0with=C2=A0the=C2=A0version=C2=A0of=C2=A0the=C2=A0remote=C2=A0end,=C2=A0instead= =C2=A0of=C2=A0the=C2=A0locally=C2=A0 =0A=C2=A0resolved=C2=A0/=C2=A0wired=C2= =A0package,=C2=A0causing=C2=A0ClassClassExceptions. =0A=0A=C2=A0Initial=C2= =A0(naive)=C2=A0first=C2=A0pass=C2=A0strategy=C2=A0of=C2=A0class=C2=A0resol= ution=C2=A0(for=C2=A0each=C2=A0 =0A=C2=A0branch=C2=A0in=C2=A0the=C2=A0seria= lized=C2=A0object=C2=A0graph)?: =0A=C2=A01.=C2=A0=C2=A0=C2=A0=C2=A0Try=C2= =A0current=C2=A0bundle=C2=A0on=C2=A0the=C2=A0stack=C2=A0(which=C2=A0will=C2= =A0be=C2=A0the=C2=A0callers=C2=A0 =0A=C2=A0bundle=C2=A0if=C2=A0we=C2=A0have= n't=C2=A0loaded=C2=A0any=C2=A0new=C2=A0bundles=C2=A0yet). =0A=C2=A02.=C2=A0= =C2=A0=C2=A0=C2=A0Then=C2=A0use=C2=A0the=C2=A0package=C2=A0name=C2=A0of=C2= =A0a=C2=A0class=C2=A0to=C2=A0determine=C2=A0if=C2=A0the=C2=A0package=C2=A0 = =0A=C2=A0is=C2=A0loaded=C2=A0by=C2=A0any=C2=A0of=C2=A0the=C2=A0bundles =0A= =C2=A0referenced=C2=A0by=C2=A0the=C2=A0callers=C2=A0bundle=C2=A0imports=C2= =A0(to=C2=A0handle=C2=A0any=C2=A0private=C2=A0 =0A=C2=A0implementation=C2= =A0packages =0A=C2=A0that=C2=A0aren't=C2=A0in=C2=A0the=C2=A0current=C2=A0im= ports).=C2=A0=C2=A0Is=C2=A0this=C2=A0a=C2=A0good=C2=A0idea?=C2=A0Or=C2=A0sh= ould=C2=A0 =0A=C2=A0we=C2=A0go=C2=A0straight=C2=A0to=C2=A0step=C2=A03 =0A= =C2=A0and=C2=A0let=C2=A0the=C2=A0framework=C2=A0resolve=C2=A0common=C2=A0cl= asses,=C2=A0what=C2=A0if=C2=A0we=C2=A0use=C2=A0a=C2=A0 =0A=C2=A0different= =C2=A0version=C2=A0to=C2=A0the =0A=C2=A0client's=C2=A0imported=C2=A0bundle?= =C2=A0=C2=A0Should=C2=A0we=C2=A0first=C2=A0compare=C2=A0our=C2=A0bundle=C2= =A0 =0A=C2=A0annotation=C2=A0to=C2=A0the=C2=A0currently =0A=C2=A0imported= =C2=A0bundles=C2=A0and=C2=A0select=C2=A0one=C2=A0of=C2=A0those=C2=A0if=C2=A0it's=C2=A0a=C2=A0compatible=C2=A0 =0A=C2= =A0version?=C2=A0=C2=A0Yes,=C2=A0this=C2=A0could=C2=A0be=C2=A0an =0A=C2=A0a= pplication=C2=A0bundle,=C2=A0otherwise=C2=A0goto=C2=A03. =0A=C2=A03.=C2=A0= =C2=A0=C2=A0=C2=A0Load=C2=A0bundle=C2=A0from=C2=A0annotation=C2=A0(if=C2=A0= already=C2=A0loaded,=C2=A0it=C2=A0will=C2=A0be=C2=A0an=C2=A0 =0A=C2=A0exact= =C2=A0version=C2=A0match).=C2=A0=C2=A0Place=C2=A0the =0A=C2=A0new=C2=A0bund= le=C2=A0on=C2=A0top=C2=A0of=C2=A0the=C2=A0bundle=C2=A0stack,=C2=A0remove=C2= =A0this=C2=A0bundle=C2=A0from=C2=A0the=C2=A0 =0A=C2=A0stack=C2=A0once=C2=A0= all=C2=A0fields=C2=A0of =0A=C2=A0this=C2=A0object=C2=A0have=C2=A0been=C2=A0= deserialized,=C2=A0returning=C2=A0to=C2=A0the=C2=A0previous=C2=A0bundle=C2= =A0 =0A=C2=A0context.=C2=A0=C2=A0We=C2=A0are=C2=A0relying =0A=C2=A0on=C2=A0= the=C2=A0current=C2=A0bundle=C2=A0to=C2=A0wire=C2=A0itself=C2=A0up=C2=A0to= =C2=A0the=C2=A0same=C2=A0package=C2=A0versions=C2=A0 =0A=C2=A0of=C2=A0the= =C2=A0clients=C2=A0bundle =0A=C2=A0imports,=C2=A0for=C2=A0shared=C2=A0class= es.=C2=A0=C2=A0Classes=C2=A0that=C2=A0use=C2=A0different=C2=A0bundles=C2=A0= will=C2=A0 =0A=C2=A0not=C2=A0be=C2=A0visible=C2=A0to=C2=A0the=C2=A0client, = =0A=C2=A0but=C2=A0will=C2=A0need=C2=A0to=C2=A0be=C2=A0visible=C2=A0to=C2=A0= the=C2=A0current=C2=A0object's=C2=A0bundle. =0A=C2=A04.=C2=A0=C2=A0=C2=A0= =C2=A0Place=C2=A0a=C2=A0bundle=C2=A0reference=C2=A0on=C2=A0the=C2=A0stack= =C2=A0when=C2=A0a=C2=A0new=C2=A0object=C2=A0is=C2=A0 =0A=C2=A0deserialized= =C2=A0from=C2=A0the=C2=A0stream=C2=A0and =0A=C2=A0remove=C2=A0it=C2=A0once= =C2=A0all=C2=A0fields=C2=A0have=C2=A0been=C2=A0deserialized.=C2=A0(we=C2=A0= might=C2=A0need=C2=A0to=C2=A0 =0A=C2=A0remember=C2=A0stack=C2=A0depth). =0A=C2=A05.=C2=A0=C2=A0=C2=A0=C2=A0Don't=C2=A0place=C2=A0non= =C2=A0bundle=C2=A0references=C2=A0on=C2=A0the=C2=A0stack.=C2=A0=C2=A0For=C2= =A0example=C2=A0 =0A=C2=A0system=C2=A0class=C2=A0loader=C2=A0or=C2=A0any = =0A=C2=A0other=C2=A0class=C2=A0loader,=C2=A0we=C2=A0want=C2=A0resolution=C2= =A0to=C2=A0occur=C2=A0via=C2=A0the=C2=A0OSGi=C2=A0 =0A=C2=A0resolution=C2= =A0process. =0A=0A=C2=A0What=C2=A0about=C2=A0a=C2=A0simpler=C2=A0strategy= =C2=A0(again=C2=A0naive),=C2=A0where=C2=A0we=C2=A0don't=C2=A0attempt=C2=A0t= o=C2=A0 =0A=C2=A0resolve=C2=A0private=C2=A0implementation=C2=A0classes? =0A= =C2=A01.=C2=A0=C2=A0=C2=A0=C2=A0The=C2=A0calling=C2=A0class'=C2=A0bundle,= =C2=A0is=C2=A0given=C2=A0priority. =0A=C2=A02.=C2=A0=C2=A0=C2=A0=C2=A0Load= =C2=A0bundle=C2=A0from=C2=A0annotation=C2=A0(exact=C2=A0version),=C2=A0when= =C2=A0not=C2=A0found=C2=A0in=C2=A0 =0A=C2=A0calling=C2=A0class. =0A=C2=A03.= =C2=A0=C2=A0=C2=A0=C2=A0No=C2=A0stack,=C2=A0what=C2=A0if=C2=A0an=C2=A0appli= cation=C2=A0bundle=C2=A0from=C2=A0server=C2=A0is=C2=A0loaded=C2=A0 =0A=C2= =A0that=C2=A0conflicts=C2=A0with=C2=A0an=C2=A0existing =0A=C2=A0bundle=C2= =A0resolved=C2=A0by=C2=A0the=C2=A0client? =0A=C2=A04.=C2=A0=C2=A0=C2=A0=C2= =A0What=C2=A0about=C2=A0walking=C2=A0back=C2=A0through=C2=A0the=C2=A0stack?= =C2=A0=C2=A0Probably=C2=A0 =0A=C2=A0unnecessary,=C2=A0as=C2=A0the=C2=A0cont= aining=C2=A0object =0A=C2=A0will=C2=A0reference=C2=A0the=C2=A0class=C2=A0by= =C2=A0a=C2=A0common=C2=A0interface,=C2=A0the=C2=A0outer=C2=A0object=C2=A0ma= y=C2=A0 =0A=C2=A0not=C2=A0need=C2=A0to=C2=A0reference =0A=C2=A0it=C2=A0at= =C2=A0all.=C2=A0=C2=A0But=C2=A0what=C2=A0if=C2=A0the=C2=A0outer=C2=A0object= =C2=A0passed=C2=A0it=C2=A0in=C2=A0during=C2=A0 =0A=C2=A0construction? =0A=0A=C2=A0Revised=C2=A0strategy: =0A=C2=A01.=C2=A0=C2=A0=C2=A0=C2= =A0Attempt=C2=A0to=C2=A0load=C2=A0from=C2=A0current=C2=A0bundle=C2=A0on=C2= =A0stack=C2=A0(the=C2=A0stack=C2=A0begins=C2=A0 =0A=C2=A0with=C2=A0the=C2= =A0client's=C2=A0Bundle,=C2=A0each =0A=C2=A0node=C2=A0in=C2=A0the=C2=A0grap= h=C2=A0has=C2=A0its=C2=A0bundle=C2=A0added=C2=A0to=C2=A0the=C2=A0stack=C2= =A0and=C2=A0is=C2=A0also=C2=A0 =0A=C2=A0removed=C2=A0after=C2=A0that=C2=A0n= ode=C2=A0is=C2=A0completely=C2=A0deserialized. =0A=C2=A02.=C2=A0=C2=A0=C2= =A0=C2=A0If=C2=A0unsuccessful,=C2=A0walk=C2=A0back=C2=A0through=C2=A0deseri= alized=C2=A0bundle=C2=A0reference=C2=A0 =0A=C2=A0stack=C2=A0and=C2=A0attemp= t=C2=A0to=C2=A0load=C2=A0class. =0A=C2=A0Why=C2=A0not=C2=A0start=C2=A0at=C2= =A0the=C2=A0beginning=C2=A0of=C2=A0the=C2=A0stack?=C2=A0=C2=A0We=C2=A0are= =C2=A0expecting=C2=A0bundles=C2=A0 =0A=C2=A0to=C2=A0wire=C2=A0up=C2=A0to = =0A=C2=A0currently=C2=A0loaded=C2=A0versions,=C2=A0but=C2=A0bundles=C2=A0ca= n=C2=A0import=C2=A0different=C2=A0package=C2=A0 =0A=C2=A0versions=C2=A0for = =0A=C2=A0implementation,=C2=A0safest=C2=A0to=C2=A0start=C2=A0with=C2=A0curr= ent=C2=A0bundle=C2=A0and=C2=A0consult=C2=A0parent=C2=A0 =0A=C2=A0if=C2=A0no= t=C2=A0found=C2=A0in=C2=A0the=C2=A0current=C2=A0bundle =0A=C2=A0dependency= =C2=A0graph,=C2=A0ie=C2=A0possibly=C2=A0passed=C2=A0in=C2=A0during=C2=A0obj= ect=C2=A0construction=C2=A0or=C2=A0 =0A=C2=A0an=C2=A0handback =0A=C2=A0impl= emented=C2=A0in=C2=A0the=C2=A0client,=C2=A0from=C2=A0an=C2=A0earlier=C2=A0i= nvocation=C2=A0or=C2=A0dependency=C2=A0 =0A=C2=A0injected. =0A=C2=A03.=C2= =A0=C2=A0=C2=A0=C2=A0The=C2=A0client=C2=A0is=C2=A0responsible=C2=A0for=C2= =A0determining=C2=A0compatibility=C2=A0with=C2=A0the=C2=A0 =0A=C2=A0service=C2=A0api=C2=A0it's=C2= =A0interested=C2=A0in =0A=C2=A0from=C2=A0the=C2=A0Import=C2=A0Package=C2=A0= Entry's,=C2=A0prior=C2=A0to=C2=A0unmarshalling=C2=A0a=C2=A0service=C2=A0pro= xy. =0A=C2=A04.=C2=A0=C2=A0=C2=A0=C2=A0If=C2=A0a=C2=A0bundle=C2=A0previousl= y=C2=A0on=C2=A0the=C2=A0stack=C2=A0resolves=C2=A0a=C2=A0class,=C2=A0then=C2= =A0this=C2=A0 =0A=C2=A0object's=C2=A0bundle=C2=A0reference=C2=A0is=C2=A0pla= ced =0A=C2=A0on=C2=A0the=C2=A0top=C2=A0of=C2=A0the=C2=A0stack,=C2=A0it=C2= =A0is=C2=A0removed=C2=A0once=C2=A0the=C2=A0current=C2=A0object=C2=A0and=C2= =A0all=C2=A0 =0A=C2=A0it's=C2=A0fields=C2=A0have=C2=A0been=C2=A0completely= =C2=A0deserialized. =0A=C2=A05.=C2=A0=C2=A0=C2=A0=C2=A0Load=C2=A0bundle=C2= =A0from=C2=A0annotation=C2=A0(exact=C2=A0version). =0A=C2=A06.=C2=A0=C2=A0= =C2=A0=C2=A0No=C2=A0attempt=C2=A0will=C2=A0be=C2=A0made=C2=A0to=C2=A0direct= ly=C2=A0load=C2=A0from=C2=A0wired=C2=A0bundles,=C2=A0 =0A=C2=A0always=C2=A0= rely=C2=A0on=C2=A0wires, =0A=C2=A0otherwise=C2=A0we=C2=A0may=C2=A0utilise= =C2=A0an=C2=A0incompatible=C2=A0package=C2=A0/=C2=A0bundle. =0A=0A=C2=A0Do= =C2=A0we=C2=A0need=C2=A0a=C2=A0graph=C2=A0of=C2=A0the=C2=A0wiring=C2=A0from= =C2=A0the=C2=A0remote=C2=A0end? =0A=C2=A0During=C2=A0serialization=C2=A0(fr= om=C2=A0the=C2=A0remote=C2=A0end)=C2=A0do=C2=A0we=C2=A0need=C2=A0to=C2=A0de= termine=C2=A0if=C2=A0 =0A=C2=A0a=C2=A0bundle=C2=A0has=C2=A0dependants=C2=A0= and=C2=A0send=C2=A0some=C2=A0sort=C2=A0of=C2=A0version=C2=A0range=C2=A0info= rmation? =0A=C2=A0When=C2=A0a=C2=A0class=C2=A0descriptor=C2=A0is=C2=A0read= =C2=A0in=C2=A0from=C2=A0a=C2=A0stream,=C2=A0the=C2=A0class=C2=A0descriptor= =C2=A0 =0A=C2=A0contains=C2=A0information =0A=C2=A0about=C2=A0fields=C2=A0and=C2=A0it's=C2=A0serializable=C2=A0= supertype=C2=A0class=C2=A0(if=C2=A0it=C2=A0exists) =0A=C2=A0are=C2=A0also= =C2=A0read=C2=A0in=C2=A0from=C2=A0the=C2=A0stream,=C2=A0before=C2=A0any=C2= =A0field=C2=A0objects=C2=A0are=C2=A0read=C2=A0 =0A=C2=A0in,=C2=A0the=C2=A0d= eclared=C2=A0field=C2=A0types =0A=C2=A0are=C2=A0visible=C2=A0from=C2=A0the= =C2=A0bundle=C2=A0of=C2=A0the=C2=A0current=C2=A0object=C2=A0being=C2=A0dese= rialized.=C2=A0=C2=A0 =0A=C2=A0The=C2=A0objects=C2=A0that=C2=A0will=C2=A0be= =0A=C2=A0assigned=C2=A0to=C2=A0those=C2=A0field=C2=A0types=C2=A0must=C2=A0= also=C2=A0resolve=C2=A0to=C2=A0those=C2=A0types.=C2=A0=C2=A0Hence=C2=A0 =0A= =C2=A0bundles=C2=A0being=C2=A0resolved=C2=A0as=C2=A0part =0A=C2=A0of=C2=A0d= eserialization=C2=A0must=C2=A0favour=C2=A0already=C2=A0resolved=C2=A0packag= es=C2=A0for=C2=A0imports. =0A=C2=A0What=C2=A0if=C2=A0a=C2=A0bundle=C2=A0req= uires=C2=A0a=C2=A0specific=C2=A0package=C2=A0version?=C2=A0=C2=A0This=C2=A0= is=C2=A0why=C2=A0the=C2=A0 =0A=C2=A0bundle=C2=A0must=C2=A0be=C2=A0given=C2= =A0first =0A=C2=A0attempt=C2=A0to=C2=A0resolve=C2=A0an=C2=A0objects=C2=A0cl= ass=C2=A0and=C2=A0rely=C2=A0on=C2=A0the=C2=A0bundle=C2=A0dependency=C2=A0 = =0A=C2=A0resolution=C2=A0process. =0A=C2=A0OSGi=C2=A0must=C2=A0be=C2=A0allo= wed=C2=A0to=C2=A0wire=C2=A0up=C2=A0dependencies,=C2=A0we=C2=A0must=C2=A0avo= id=C2=A0attempting=C2=A0 =0A=C2=A0to=C2=A0make=C2=A0decisions=C2=A0about = =0A=C2=A0compatibility=C2=A0and=C2=A0use=C2=A0the=C2=A0current=C2=A0bundle= =C2=A0wires=C2=A0instead=C2=A0(our=C2=A0stack). =0A=0A=C2=A0The=C2=A0Bundle= Reference=C2=A0stack=C2=A0is=C2=A0designed=C2=A0to=C2=A0follow=C2=A0the=C2=A0wires=C2=A0(dependency=C2=A0 =0A=C2=A0links=C2=A0between=C2=A0bundle= s), =0A=C2=A0to=C2=A0allow=C2=A0private=C2=A0classes=C2=A0to=C2=A0be=C2=A0r= esolved,=C2=A0as=C2=A0they're=C2=A0not=C2=A0visible=C2=A0from=C2=A0 =0A=C2= =A0other=C2=A0bundles. =0A=0A=C2=A0We=C2=A0can't=C2=A0rely=C2=A0on=C2=A0ann= otations=C2=A0to=C2=A0resolve=C2=A0private=C2=A0classes,=C2=A0because=C2=A0= we=C2=A0 =0A=C2=A0can't=C2=A0predict=C2=A0the=C2=A0way=C2=A0bundle =0A=C2= =A0dependency's=C2=A0are=C2=A0resolved=C2=A0in=C2=A0remote=C2=A0JVM's. =0A= =0A=C2=A0General=C2=A0recommendations=C2=A0for=C2=A0OSGi: =0A=C2=A0*=C2=A0= =C2=A0=C2=A0=C2=A0The=C2=A0service=C2=A0should=C2=A0use=C2=A0as=C2=A0wide= =C2=A0a=C2=A0version=C2=A0range=C2=A0as=C2=A0possible=C2=A0for=C2=A0 =0A=C2= =A0service=C2=A0api. =0A=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0It=C2=A0is=C2=A0bett= er=C2=A0to=C2=A0create=C2=A0new=C2=A0service=C2=A0api=C2=A0in=C2=A0a=C2=A0n= ew=C2=A0bundle=C2=A0than=C2=A0to=C2=A0 =0A=C2=A0evolve=C2=A0in=C2=A0a=C2=A0= backward=C2=A0compatible=C2=A0manner,=C2=A0as =0A=C2=A0an=C2=A0incremental= =C2=A0change=C2=A0may=C2=A0not=C2=A0be=C2=A0compatible=C2=A0if=C2=A0additio= nal=C2=A0classes=C2=A0and=C2=A0 =0A=C2=A0methods=C2=A0are=C2=A0missing =0A= =C2=A0from=C2=A0the=C2=A0client,=C2=A0that=C2=A0the=C2=A0service=C2=A0proxy= =C2=A0depends=C2=A0on. =0A=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0Don't=C2=A0split= =C2=A0packages. =0A=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0Private=C2=A0implementati= on=C2=A0classes=C2=A0are=C2=A0ok,=C2=A0provided=C2=A0they=C2=A0remain=C2=A0= =0A=C2=A0within=C2=A0public=C2=A0exported=C2=A0classes=C2=A0and=C2=A0don't= =C2=A0escape,=C2=A0otherwise =0A=C2=A0they=C2=A0may=C2=A0not=C2=A0link=C2= =A0up=C2=A0properly=C2=A0upon=C2=A0deserialization. =0A=C2=A0*=C2=A0=C2=A0=C2=A0=C2=A0The=C2=A0proxy=C2=A0should= =C2=A0minimise=C2=A0the=C2=A0package=C2=A0imports=C2=A0it=C2=A0uses. =0A=C2= =A0*=C2=A0=C2=A0=C2=A0=C2=A0There=C2=A0must=C2=A0be=C2=A0only=C2=A0one=C2= =A0compatible=C2=A0service=C2=A0api=C2=A0version=C2=A0installed=C2=A0 =0A= =C2=A0already=C2=A0in=C2=A0the=C2=A0client. =0A=C2=A0*=C2=A0=C2=A0=C2=A0=C2= =A0Duplicates=C2=A0of=C2=A0incompatible=C2=A0versions=C2=A0of=C2=A0service= =C2=A0api=C2=A0are=C2=A0ok. =0A=0A=C2=A0The=C2=A0catch=C2=A0is,=C2=A0it=C2= =A0may=C2=A0not=C2=A0be=C2=A0possible=C2=A0to=C2=A0build=C2=A0the=C2=A0bund= le=C2=A0stack=C2=A0without=C2=A0 =0A=C2=A0some=C2=A0programming=C2=A0hooks= =C2=A0in=C2=A0ObjectInputStream. =0A=0A=C2=A0Unfortunately=C2=A0we=C2=A0don= 't=C2=A0have=C2=A0any=C2=A0control=C2=A0over=C2=A0OIS,=C2=A0the=C2=A0necess= ary=C2=A0hooks=C2=A0 =0A=C2=A0could=C2=A0however=C2=A0be=C2=A0added=C2=A0to= =C2=A0AtomicMarshalInputStream. =0A=0A=C2=A0Cheers, =0A=0A=C2=A0Peter. =0A= =0A=0A=0A=0A --8323328-1148864512-1486497890=:1378--