Return-Path: X-Original-To: apmail-river-dev-archive@www.apache.org Delivered-To: apmail-river-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 310BBD18C for ; Sun, 26 Aug 2012 18:11:43 +0000 (UTC) Received: (qmail 13345 invoked by uid 500); 26 Aug 2012 18:11:42 -0000 Delivered-To: apmail-river-dev-archive@river.apache.org Received: (qmail 13313 invoked by uid 500); 26 Aug 2012 18:11:42 -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 13304 invoked by uid 99); 26 Aug 2012 18:11:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Aug 2012 18:11:42 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of greggwon@gmail.com designates 209.85.160.43 as permitted sender) Received: from [209.85.160.43] (HELO mail-pb0-f43.google.com) (209.85.160.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Aug 2012 18:11:36 +0000 Received: by pbbrq2 with SMTP id rq2so5521423pbb.2 for ; Sun, 26 Aug 2012 11:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=HUbJ2zeOIl+N5+RZPfeDUQeXzYjlLtvbjDl7JtTkgHs=; b=Ct94Pny/GltckQSlQ0zDsLICagRghpjHTY0AAU9ZxcXUpMnS6L/FhaVSTMGFfMBpNV tHBwY18Gk6pu41GrQZ1VSOLOAq9GhF/zQGtybKdQtcLouFy/PH5gbABcgZoNjPfYi4u9 499C6GgK8aofALDhjfEBSAfPUh8eq7tbpRLwDQpddFtxaXRYHQRR+nrNVRdoGRXAOmUK XAyynKdV5A/ZwsFl/ZK7rGvE9/5IL9OzfjNkgvf3Y1Q1zNI2sVjlGpaDBVaF0M8BczwU gZu4Vj1vM3XAO32Tlsne9MtqMWCMnYW2vD3c6ga51mudrrGOZZwE8vkCyCsR9o3S7w4+ rgew== Received: by 10.66.78.99 with SMTP id a3mr24952499pax.22.1346004675985; Sun, 26 Aug 2012 11:11:15 -0700 (PDT) Received: from [192.168.1.112] (ip70-189-99-89.ok.ok.cox.net. [70.189.99.89]) by mx.google.com with ESMTPS id qx8sm12906192pbc.63.2012.08.26.11.11.14 (version=SSLv3 cipher=OTHER); Sun, 26 Aug 2012 11:11:14 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Subject: Re: Develop new spec for RMIClassLoader replacement From: Gregg Wonderly In-Reply-To: <1345990661.7614.16.camel@cameron> Date: Sun, 26 Aug 2012 13:11:12 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <5030D778.6030609@zeus.net.au> <50360C90.4000004@qcg.nl> <503627FF.10405@zeus.net.au> <1345746340.2530.220.camel@cameron> <5039E41E.7050702@zeus.net.au> <1345990661.7614.16.camel@cameron> To: dev@river.apache.org X-Mailer: Apple Mail (2.1485) X-Virus-Checked: Checked by ClamAV on apache.org On Aug 26, 2012, at 9:17 AM, Greg Trasuk wrote: > See comments interspersed... >=20 >=20 > On Sun, 2012-08-26 at 04:53, Peter Firmstone wrote: >> There are some notable conditions that may exist in modular = environments. >>=20 >> 1. Lets get this out of the way first: Preferred proxy classes are >> implementation classes, the modular environment has no place >> managing proxy private implementation classes. >> 2. In addition to the marshaled smart proxy implementation, >> Serialized objects will be transferred between remote hosts and >> these may not belong to the proxy preferred class list, instead >> they will belong to the Java or Jini platforms, or the Service >> API, a local modular environment requires these objects be >> instantiated by the correct class instance, which may reside in >> different ClassLoaders. >> 3. Different versions of classes may be present locally in separate >> ClassLoaders. >> 4. Resolving classes for objects a smart proxy refers to may not be >> visible via traditionally expected ClassLoader hierarchy trees. =20= >> These classes may need to be found by other means. These = classes >> needn't be visible to the smart proxy, fields may refer to a >> common super class or interface. >> 5. Service API must reside in a parent ClassLoader, so we need to >> know super class names, to be able to nominate a suitable parent >> ClassLoader for a smart proxy. >>=20 > Small point - #5 isn't quite true, although that's the way most > containers, Jini and otherwise, seem to operate. For instance, in = most > servlet containers, the servlet API is in a parent classloader to the > servlet itself. Similarly, in the Jini Starter utility, the River API > classes are in a parent classloader. This is usually done for the > convenience of the container - it allows the container to access the > same classes that the application does, without needing to use > reflection. >=20 > The correct, and slightly looser, constraint is that classes and > interfaces used in the API must be visible to application classes. = They > could be in the same classloader as the applicaton classes. In the > River container I'm working on in /skunk, the service API classes are > actually in the same classloader as the application (much like the > application would include the interface classes for a user-written > service). The container communicates with the application using the > Reflection API, and doesn't share any classloaders with the contained > applications (except the system CL, of course). >=20 > I guess what I'm saying is that it's hazardous to assume any = particular > classloader hierarchy. The classloader used to house the proxy should > probably just have the application's context class loader as its = parent. This is the flexibility that I think we need to focus on. We need to = think about class origins, and any time/place that River is interacting = with class loading, we should try and evaluate how that can be the least = troublesome. In some cases, no-flexibility can be less trouble. 100 = interfaces and abstract classes don't always make the best programming = environment. One way to do things, which works well, can be a good = thing. >=20 >> This won't be so hard to implement if we have a ClassLoader registry = and=20 >> we know super class names and version information, this information = is=20 >> currently not annotated with the Object stream. >>=20 > I don't think versions are required. Simply load any preferred = classes > from the codebase url that the remote object provides. I'd like to keep "Versioning" completely out of what River considers as = part of the "platform". The plugability of class loading should not = hinder the use of versioning. It may be a good idea to put down some = sentences which represent the features which we all agree versioning is = represented by. Then we can keep River from prohibiting those things as = a choice. Gregg