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 8BFA3200C32 for ; Thu, 23 Feb 2017 06:26:32 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8A91C160B72; Thu, 23 Feb 2017 05:26:32 +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 A6310160B62 for ; Thu, 23 Feb 2017 06:26:31 +0100 (CET) Received: (qmail 49696 invoked by uid 500); 23 Feb 2017 05:26:28 -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 49668 invoked by uid 99); 23 Feb 2017 05:26:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 05:26:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 0C863C1F58 for ; Thu, 23 Feb 2017 05:26:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=zeus.net.au Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id rAUpUDTeZ8xT for ; Thu, 23 Feb 2017 05:26:24 +0000 (UTC) Received: from server-2b-r4.ipv4.au.syrahost.com (server-2b-r4.ipv4.au.syrahost.com [103.250.215.83]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 0ACFD5FE3F for ; Thu, 23 Feb 2017 05:26:23 +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=ujxZT1oaY2DejU6FqGtevxJxk+B1jqy2K8XPSVN3KL0=; b=leTaiLr86VM5MzxS9P+PFk2nbR W32zfPpPBPacRgEDuFCy6H4Ux3AGRe+iJlNYVEfTdsUfjx5k12sUFZZ9jZCsB431sOrdPYseQ0ffZ A63Ycwl3pV+vttpW9/X/Sj4IQfZtFM4U2BkiThLr6XdeIfOXwSCV9qNXI8Uam7Mbgekc=; Received: from pa49-197-180-147.pa.qld.optusnet.com.au ([49.197.180.147]:22237 helo=[10.181.36.213]) by webcloud66.au.syrahost.com with esmtpsa (TLSv1:ECDHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1cglv1-001nOF-K0 for dev@river.apache.org; Thu, 23 Feb 2017 13:26:20 +0800 Date: Thu, 23 Feb 2017 15:26:15 +1000 (AEST) From: Peter Subject: OSGi Bundles for services To: "dev@river.apache.org" Message-ID: <224914786d291f90bd492a0003282852@org.tizen.email> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1424321324-1487827575=:1321" 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: Thu, 23 Feb 2017 05:26:32 -0000 --8323328-1424321324-1487827575=:1321 Content-Type: MULTIPART/ALTERNATIVE; BOUNDARY="8323328-1289003160-1487827575=:1321" --8323328-1289003160-1487827575=:1321 Content-Type: TEXT/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE I've attached some ASCII of the relationship between server and client jvm = bundles.=0A=0AThe ClassLoader at the server is set using the invocation lay= er factory (a configuration item).=0A=0AThe client ClassLoader is determine= d during delayed unmarshalling and smart proxy bundle provisioning.=0A=0ATh= is ensures that deserialization at each endpoint has a compatible view of c= lasses (as recently discussed on osgi-dev).=0A=0AIt's important at this tim= e to distinguish between remote objects and remote services, registered wit= h a lookup service.=0A=0AA remote service must have a proxy bundle for OSGi= =C2=A0The proxy bundle manifest determines requirements and wiring to pac= kage import versions. =C2=A0This includes dynamic proxy based services.=0A= =0AFor arguments sake, a remote object becomes a remote service when it is = registered with a lookup service.=0A=0AA remote object isn't registered wit= h a lookup service. =C2=A0Listeners are typically remote objects. =C2=A0In = OSGi, it is advisable for remote objects to be dynamic proxy's without a co= debase. =C2=A0Remote Object proxy's will be deserialized into the remote endpoint's nominated Cl= assLoader. =C2=A0For example, if it is transferred via a service, the remot= e object's dynamic proxy stub will be loaded into the service's proxy bundl= e ClassLoader in the server jvm.=0A=0AAs Nic pointed out earlier, Bundle Cl= assLoader's are not instances of URLClassLoader and lack codebase annotatio= ns as a result.=0A=0AWith the above rules in place, there is no need to cre= ate a custom RMIClassLoaderSpi specific to OSGi.=0A=0AWith the above rules = in place, it does open up an opportunity to use a remote object (eg a liste= ner) with a conventional codebase as Mic had requested. =C2=A0 This would u= se the PreferredClassProvider infrastructure, so the remote object proxy Pr= eferredClassLoader would utilise the services server jvm proxy bundle Class= Loader as it's parent. =C2=A0This style of remote object should not be regi= stered as a remote service.=0A=0AI would probably discourage this use case,= except for advanced users.=0A=0AI think we need to make a distinction betw= een remote services and remote objects for OSGi.=0A=0AThis is a very practical = solution for OSGi.=0A=0ARegards,=0A=0APeter.=0A=0A=0ASent from my Samsung d= evice.=0A=C2=A0 --8323328-1289003160-1487827575=:1321 Content-Type: TEXT/html; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE
I've attached some ASCII of the relationship = between server and client jvm bundles.

The ClassLoader at the server is set using the invocation la= yer factory (a configuration item).

The client ClassLoader is determined during delayed unmarshalli= ng and smart proxy bundle provisioning.

This ensures that deserialization at each endpoint has a co= mpatible view of classes (as recently discussed on osgi-dev).

It's important at this time to distin= guish between remote objects and remote services, registered with a lookup = service.

A remote servic= e must have a proxy bundle for OSGi.  The proxy bundle manifest determ= ines requirements and wiring to package import versions.  This include= s dynamic proxy based services.

For arguments sake, a remote object becomes a remote service wh= en it is registered with a lookup service.

A remote object isn't registered with a lookup service. =  Listeners are typically remote objects.  In OSGi, it is advisabl= e for remote objects to be dynamic proxy's without a codebase.  Remote= Object proxy's will be deserialized into the remote endpoint's nominated C= lassLoader.  For example, if it is transferred via a service, the remo= te object's dynamic proxy stub will be loaded into the service's proxy bund= le ClassLoader in the server jvm.

As Nic pointed out earlier, Bundle= ClassLoader's are not instances of URLClassLoader and lack codebase annota= tions as a result.

With = the above rules in place, there is no need to create a custom RMIClassLoade= rSpi specific to OSGi.

W= ith the above rules in place, it does open up an opportunity to use a remote object (eg a listener) with a conventional codebase as Mic = had requested.   This would use the PreferredClassProvider infrastruct= ure, so the remote object proxy PreferredClassLoader would utilise the serv= ices server jvm proxy bundle ClassLoader as it's parent.  This style o= f remote object should not be registered as a remote service.

I would probably discourage this use = case, except for advanced users.

I think we need to make a distinction between remote services and= remote objects for OSGi.

This is a very practical solution for OSGi.

Regards,

Peter.


Sent from my Samsung device.
 
=0A=0A=0A=0A=0A= --8323328-1289003160-1487827575=:1321-- --8323328-1424321324-1487827575=:1321--