Return-Path: Delivered-To: apmail-incubator-river-dev-archive@minotaur.apache.org Received: (qmail 28321 invoked from network); 14 Oct 2009 16:42:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Oct 2009 16:42:45 -0000 Received: (qmail 90862 invoked by uid 500); 14 Oct 2009 16:42:45 -0000 Delivered-To: apmail-incubator-river-dev-archive@incubator.apache.org Received: (qmail 90811 invoked by uid 500); 14 Oct 2009 16:42:44 -0000 Mailing-List: contact river-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: river-dev@incubator.apache.org Delivered-To: mailing list river-dev@incubator.apache.org Received: (qmail 90800 invoked by uid 99); 14 Oct 2009 16:42:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2009 16:42:44 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of SRS0=zICJpF=GD=wonderly.org=gregg@yourhostingaccount.com designates 65.254.253.116 as permitted sender) Received: from [65.254.253.116] (HELO mailout14.yourhostingaccount.com) (65.254.253.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Oct 2009 16:42:34 +0000 Received: from mailscan06.yourhostingaccount.com ([10.1.15.6] helo=mailscan06.yourhostingaccount.com) by mailout14.yourhostingaccount.com with esmtp (Exim) id 1My6vV-0005jg-Sh for river-dev@incubator.apache.org; Wed, 14 Oct 2009 12:42:13 -0400 Received: from impout02.yourhostingaccount.com ([10.1.55.2] helo=impout02.yourhostingaccount.com) by mailscan06.yourhostingaccount.com with esmtp (Exim) id 1My6vV-0001zd-PW for river-dev@incubator.apache.org; Wed, 14 Oct 2009 12:42:13 -0400 Received: from authsmtp09.yourhostingaccount.com ([10.1.18.9]) by impout02.yourhostingaccount.com with NO UCE id sgiD1c0080BkWne0000000; Wed, 14 Oct 2009 12:42:13 -0400 X-EN-OrigOutIP: 10.1.18.9 X-EN-IMPSID: sgiD1c0080BkWne0000000 Received: from wsip-70-184-37-175.tu.ok.cox.net ([70.184.37.175] helo=[192.168.5.109]) by authsmtp09.yourhostingaccount.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim) id 1My6vV-0002eP-7x for river-dev@incubator.apache.org; Wed, 14 Oct 2009 12:42:13 -0400 Message-ID: <4AD5FF60.2070207@wonderly.org> Date: Wed, 14 Oct 2009 11:42:08 -0500 From: Gregg Wonderly User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: river-dev@incubator.apache.org Subject: Separating out RMIClassLoader dependencies Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-EN-UserInfo: 5bac21c6012e8295aaee92c67842fba3:d1e94006e19829b2b3cf849ab9ff0f3c X-EN-AuthUser: greggwon Sender: Gregg Wonderly X-EN-OrigIP: 70.184.37.175 X-EN-OrigHost: wsip-70-184-37-175.tu.ok.cox.net X-Virus-Checked: Checked by ClamAV on apache.org As I try to put together some netbeans modules for Jini development tasks, I am fighting with netbeans classloader use alot (and not actually winning it seems). So I am thinking (actually I'm trying some of this out) about whether it would make sense to help with OSGi and other classloader integration as well, if we could put an SPI in front of the use of RMIClassLoader.loadClass() etc so that different environments could provide more deliberate control over where classes are resolved. The problem I am having in netbeans is that I need the PreferredClassProvider and jsk-resources.jar which provides the Jini RMIClassLoaderSpi to be in the JVM system class loader to make it active. Yet that class loader is invisible to the netbeans module subsystem because it provides brickwall separation of the modules from each other through separate classloaders that will delegate to the netbeans system class loader. All of the delegation back and forth is what I am fighting with. What I am playing with is creating a static class that mimics the RMIClassLoaderSpi by providing the same methods, but which then also provides a security controlled setter to set the implementation. An interface would then document the methods that this SPI requires, and then implementation of that interface could be "set" on this static class. The simple nature of this change means that we can just replace RMIClassLoader references with the static class reference, and provide a simple implementation of the interface that just uses RMIClassLoader.xxxx() calls for implementation. That would put the code in a position to accept pluggable implementations of class resolution I believe. However, I'm still trying to think through how PreferredClassProvider and ClassLoading interact with RMIClassLoaderSPI to see if I've forgotten something big. I'm curious if anyone from the Jini team at Sun has any insight into whether this would really make it possible to better control which class loaders are used. Right now, there are several places in the Jini code where null ClassLoader references end up redirecting loading into the netbeans context class loader which is almost always the netbeans system class loader, and I'm having a hard time keeping the codebase loader visible. Anyone have thoughts or questions? Gregg Wonderly