Return-Path: Delivered-To: apmail-felix-dev-archive@www.apache.org Received: (qmail 68033 invoked from network); 9 Oct 2010 13:09:07 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Oct 2010 13:09:07 -0000 Received: (qmail 76576 invoked by uid 500); 9 Oct 2010 13:09:07 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 76249 invoked by uid 500); 9 Oct 2010 13:09:03 -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 76236 invoked by uid 99); 9 Oct 2010 13:09:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 13:09:02 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fmeschbe@gmail.com designates 209.85.214.49 as permitted sender) Received: from [209.85.214.49] (HELO mail-bw0-f49.google.com) (209.85.214.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 13:08:52 +0000 Received: by bwz2 with SMTP id 2so1375732bwz.22 for ; Sat, 09 Oct 2010 06:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=Ps3HTXsXTELJ7tpnK1RwJGFaEPO56MfXjotMdhmnOuo=; b=FooFj1QcPQDyoXnFLllnIqBagL0a3RE81K6ZWCSf/KvTCFg0Hnm4FpmVO5AR5lp/XL KEesw0vBmL1gi+UWTW+NgmQz8x0m6VOxrQC88cEUQ39Z5SzjJQgqL3DdLbGLXEBe7nWc T5MIFo6K7h0fwbwHx2pzhzYH3A+9TR0ZaTtKA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=KIz5qnojoMEk5VLABejRs5NzXy8/HH4af+wemocyeQcuSnnJj67GL4wsUfLYLahNx1 7jxjonFiKLbDEFfR11xsev85gZPunzHLaIGGPzbQqHRlSpxMcwu4INMcLxg7Xz/cbBZR cySA+3QO3SUJmKTXBJVJFH8hQYRv9jjQlkZLQ= Received: by 10.204.85.90 with SMTP id n26mr2951785bkl.109.1286629712124; Sat, 09 Oct 2010 06:08:32 -0700 (PDT) Received: from [192.168.1.21] (cable-static-182-112.eblcom.ch [87.102.182.112]) by mx.google.com with ESMTPS id 4sm818548bki.1.2010.10.09.06.08.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 09 Oct 2010 06:08:29 -0700 (PDT) Message-ID: <4CB0694B.8060608@gmail.com> Date: Sat, 09 Oct 2010 15:08:27 +0200 From: Felix Meschberger User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: dev@felix.apache.org Subject: Re: [DISCUSS] Containerisms References: <4CAF4A3F.4050406@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 08.10.2010 20:08, Guillaume Nodet wrote: > On Fri, Oct 8, 2010 at 18:43, Felix Meschberger wrote: > >> Hi, >> >> First of all: I agree with Richard in that we should at all cost prevent >> containerisms. >> >> Second: I do not really understand what the problem is, that must be >> solved with this containerism and which cannot be solved with regular >> OSGi API. >> > > The real problem is to be able to discover resources in the bundle class > space. For example, i want to know all resources in foo/bar/**/*.xml The > OSGi API does not provide any way to do that atm and a lot of libraries use > some custom things based on jars / file urls to actually iterate and > discover those resources. I wonder how you would be able scan the class space by pure ClassLoader API, unless you check for the class loader being an URLClassLoader and access the configured URLs.... But then: How about the Bundle.findeEntries ? > > The problem is just about a way to actually do things. It seems in the > enterprise world (JEE, middleware), we're more keen on bending the purity a > bit to the benfit of being able to achieve our goals and we're also more > keen on doing that for third party libraries. Yeah, and I would be so undiplomatic to say, that this is at the heart of today's J2EE mess .... IMHO you can bend the purity once, but you then will bend it twice, three times, etc. Until end up in a complete mess ... My intepretation is that the J2EE world has realized this stituation, starts embracing OSGi and along the lines of "getting stuff done by bending purity if required" now starts and tries to do the same to the OSGi specs. I am not really happy with this development .... But this is diverting this discussion ... Regards Felix > > It's true that if you write the whole osgi application from scratch, you > don't really care about supporting third party libraries. Unfortunately, > people just won't rewrite a third party product they already use just > because they want to play nicely in OSGi. That's my use case, and it seems > it doesn't fit well with Felix goals, so I guess i'll have to support a > custom felix version in order to do that or only support equinox. > > I think I'll revert my commit as if the plan is to ditch it in the next > felix version, there's really no point in even using such a hack from my > pov. > > >> >> Third: For us outsiders of the specification process it is very hard to >> understand what insiders are talking of with respect to upcoming >> specifications (I only learned 5 minutes ago, that there is a public >> draft for 4.3). This issue must probably be solved by OSGi... >> >> Regards >> Felix >> >> On 08.10.2010 16:37, Guillaume Nodet wrote: >>> I was planning to start a discussion around that, so let's do that now. >>> >>> I'm not convinced we should remove this hack when classpath scanning is >>> implemented, mostly because even if then ultimately try to solve the same >>> problem, they will certainly do it in a different way. What I mean is >> that >>> AFAIK, the classpath scanning stuff will result in a new api on the >> bundle >>> or bundleContext to iterate through resources, which means that in order >> to >>> support existing libraries, you kinda have to rewrite the whole thing in >>> order to accomodate those apis (especially if they are written so that >> they >>> work outside of osgi). >>> I think the hack i've written allows a smoother integration of those >>> libraries, with the drawback that you know it can break in certain >>> conditions. >>> >>> Also, your comment says "Do not make containerisms public." >>> In that case, it's not really public because the public face of the Felix >>> Framework is the OSGi api. >>> I guess the question comes down to wether we want Felix to remain pure >>> (without containerisms) or make it easier for people to use it (by >> bending >>> the edges when it makes sense to allow people to deploy their existing >>> libraries without rewriting the whole thing). >>> Imho, Felix is not a research prototype, nor supposed to be the cleaneest >>> reference implementation of OSGi, so adapting to the users makes sense >> imho, >>> provided that it's done conciensouly by the user by activating a flag or >>> accessing a non public api (we fall in that case here imho). >>> >>> Thoughts? >>> >>> On Fri, Oct 8, 2010 at 16:22, wrote: >>> >>>> Author: rickhall >>>> Date: Fri Oct 8 14:22:39 2010 >>>> New Revision: 1005843 >>>> >>>> URL: http://svn.apache.org/viewvc?rev=1005843&view=rev >>>> Log: >>>> Do not make containerisms public. (FELIX-2645) >>>> >>>> Modified: >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Content.java >>>> >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Module.java >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -610,6 +610,7 @@ class ExtensionManager extends URLStream >>>> return null; >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> public URL getEntryAsURL(String name) >>>> { >>>> return null; >>>> @@ -763,6 +764,7 @@ class ExtensionManager extends URLStream >>>> return >>>> getClass().getClassLoader().getResourceAsStream(urlPath); >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is >> implemented. >>>> public URL getLocalURL(int index, String urlPath) >>>> { >>>> return getClass().getClassLoader().getResource(urlPath); >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -1091,6 +1091,7 @@ public class ModuleImpl implements Modul >>>> return getContentPath()[index - 1].getEntryAsStream(urlPath); >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> public URL getLocalURL(int index, String urlPath) >>>> { >>>> if (urlPath.startsWith("/")) >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleURLConnection.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -28,7 +28,7 @@ import org.apache.felix.framework.resolv >>>> >>>> import org.apache.felix.framework.util.Util; >>>> >>>> -public class URLHandlersBundleURLConnection extends URLConnection >>>> +class URLHandlersBundleURLConnection extends URLConnection >>>> { >>>> private Felix m_framework; >>>> private Module m_targetModule; >>>> @@ -201,7 +201,8 @@ public class URLHandlersBundleURLConnect >>>> * >>>> * @return the local URL >>>> */ >>>> - public URL getLocalURL() >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> + URL getLocalURL() >>>> { >>>> if ((m_targetModule == null) || (m_classPathIdx < 0)) >>>> { >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/ContentDirectoryContent.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -82,6 +82,7 @@ public class ContentDirectoryContent imp >>>> return m_content.getEntryAsStream(m_rootPath + name); >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> public URL getEntryAsURL(String name) >>>> { >>>> return m_content.getEntryAsURL(m_rootPath + name); >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/DirectoryContent.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -133,6 +133,7 @@ public class DirectoryContent implements >>>> return new FileInputStream(new File(m_dir, name)); >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> public URL getEntryAsURL(String name) >>>> { >>>> if ((name.length() > 0) && (name.charAt(0) == '/')) >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/cache/JarContent.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -192,6 +192,7 @@ public class JarContent implements Conte >>>> return is; >>>> } >>>> >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> public URL getEntryAsURL(String name) >>>> { >>>> try >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Content.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Content.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Content.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Content.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -120,5 +120,6 @@ public interface Content >>>> * @return A URL using a standard protocol such as file, jar >>>> * or null if not possible. >>>> */ >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> URL getEntryAsURL(String name); >>>> } >>>> \ No newline at end of file >>>> >>>> Modified: >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Module.java >>>> URL: >>>> >> http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Module.java?rev=1005843&r1=1005842&r2=1005843&view=diff >>>> >>>> >> ============================================================================== >>>> --- >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Module.java >>>> (original) >>>> +++ >>>> >> felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/Module.java >>>> Fri Oct 8 14:22:39 2010 >>>> @@ -72,5 +72,6 @@ public interface Module >>>> throws IOException; >>>> InputStream getInputStream(int index, String urlPath) >>>> throws IOException; >>>> + // TODO: REMOVE - Remove when class path scanning is implemented. >>>> URL getLocalURL(int index, String urlPath); >>>> } >>>> \ No newline at end of file >>>> >>>> >>>> >>> >>> >> > > >