You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2010/10/08 16:37:43 UTC

[DISCUSS] Containerisms

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, <ri...@apache.org> 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
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/8/10 11:01, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 16:44, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/8/10 10: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?
>>>
>> I disagree almost completely.
>>
>> Any move toward containerisms just creates bundles that do not run on all
>> OSGi frameworks -- they are no longer bundles, but something that is like a
>> bundle.
>>
> That's plain wrong.  It only means one particular thing is tied to Felix.
>   The library i'm working on has two different paths wether it's deployed in
> Felix or Equinox for example.

So this bundle is then tied to two different frameworks...not much better.

> I agree it's not the best thing to do, but
> the other way is simply to drop Felix because it can not be bend enough.
> In that case, the problem is tied to the spring framework which is heavily
> used, and i just can't rewrite the whole thing ;-)

I agree, you can't rewrite Spring. But that doesn't mean that we should 
be creating all sorts of containerisms to support any use case that 
anyone has. We all know how this goes, these containerisms are not 
considered implementation API by those who use them and they end up 
holding us responsible for this API as public API for the end of time. 
It's hard enough being able to refactor internally at will without 
breaking what we have to expose, let alone a lot more nuanced and 
fine-grained containerisms.

If that means that people have to drop the Felix framework, then so be 
it. It likely means they'll only work on Equinox and as long as they are 
content having a single supplier, I think we are fine with that too. The 
OSGi community has already known this distinction between the two 
framework implementations for a long time.

Of course, this is all a general argument. Each area in which someone 
might want to bend is always open for discussion on a case-by-case 
basis, but taken in total I believe we should avoid containerisms like 
the plague.

>> If the official OSGi API is not sufficient, then it should be pushed into a
>> direction that makes it sufficient. We shouldn't go about making our own
>> framework API, then people will really have to worry about whether Felix
>> bundles are tied to the Felix framework, which is something that is hard
>> enough to educate people about in the first place.
>>
> When you write a bundle, you can easily test it under the environment it
> supposed to work.  I can't imagine someone using such a hack not being aware
> it's tied to Felix ....   .  So he knows what platforms are supported.
> It's the same as specifiying JDK 1.5 or JDK 1.6 when you write some java
> code: you just specifiy the environment where it has been tested and it
> works.  In my case, I plan to test it under Equinox and Felix and try to
> ensure it works under both platforms, even if i need an if block to make
> that work.  And if I want to write a bundle that only works with Felix, it's
> my decision to take, not yours I think.
>
> Purety is nice, and that's what the OSGi API is for.  Now if we want Felix
> and OSGi to be as widely used as possible, we need to make things to work.
> Rejecting containerisms on the principle that they are not pure will not
> really help doing that I think.

Perhaps so, but I'm willing to pay that price. I'm sure you've seen all 
of the crap coming down the pike for R4.3...that will keep us plenty busy.

-> richard

>
>
>> ->  richard
>>
>>
>>   On Fri, Oct 8, 2010 at 16:22,<ri...@apache.org>   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
>>>>
>>>>
>>>>
>>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Fri, Oct 8, 2010 at 16:44, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/8/10 10: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?
>>
>
> I disagree almost completely.
>
> Any move toward containerisms just creates bundles that do not run on all
> OSGi frameworks -- they are no longer bundles, but something that is like a
> bundle.
>

That's plain wrong.  It only means one particular thing is tied to Felix.
 The library i'm working on has two different paths wether it's deployed in
Felix or Equinox for example.  I agree it's not the best thing to do, but
the other way is simply to drop Felix because it can not be bend enough.
In that case, the problem is tied to the spring framework which is heavily
used, and i just can't rewrite the whole thing ;-)


>
> If the official OSGi API is not sufficient, then it should be pushed into a
> direction that makes it sufficient. We shouldn't go about making our own
> framework API, then people will really have to worry about whether Felix
> bundles are tied to the Felix framework, which is something that is hard
> enough to educate people about in the first place.
>

When you write a bundle, you can easily test it under the environment it
supposed to work.  I can't imagine someone using such a hack not being aware
it's tied to Felix ....   .  So he knows what platforms are supported.
It's the same as specifiying JDK 1.5 or JDK 1.6 when you write some java
code: you just specifiy the environment where it has been tested and it
works.  In my case, I plan to test it under Equinox and Felix and try to
ensure it works under both platforms, even if i need an if block to make
that work.  And if I want to write a bundle that only works with Felix, it's
my decision to take, not yours I think.

Purety is nice, and that's what the OSGi API is for.  Now if we want Felix
and OSGi to be as widely used as possible, we need to make things to work.
Rejecting containerisms on the principle that they are not pure will not
really help doing that I think.



> -> richard
>
>
>  On Fri, Oct 8, 2010 at 16:22,<ri...@apache.org>  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
>>>
>>>
>>>
>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/8/10 10: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?

I disagree almost completely.

Any move toward containerisms just creates bundles that do not run on 
all OSGi frameworks -- they are no longer bundles, but something that is 
like a bundle.

If the official OSGi API is not sufficient, then it should be pushed 
into a direction that makes it sufficient. We shouldn't go about making 
our own framework API, then people will really have to worry about 
whether Felix bundles are tied to the Felix framework, which is 
something that is hard enough to educate people about in the first place.

-> richard

> On Fri, Oct 8, 2010 at 16:22,<ri...@apache.org>  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
>>
>>
>>
>

Re: [DISCUSS] Containerisms

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 08.10.2010 21:16, Richard S. Hall wrote:
>  On 10/8/10 15:11, Guillaume Nodet wrote:
>> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<he...@ungoverned.org> 
>> wrote:
>>
>>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>
>>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>   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.
>>>>
>>> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>>> sounds like it is intended to do exactly what you want, no?
>>>
>>> ->  richard
>>>
>>>
>> No, I missed that point in the draft, thx for the pointer.  So what if I
>> want to bring that into Felix Framework?
>> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
>> Would that work for everyone ?
> 
> Fine by me.

+1

Even though I think this property is rather intrusive into the
implementation detail of an OSGi specification .... (is that one of
those bendings of purity ?)

Regards
Felix


> 
> I imagine we could have figured this out if you tried to discuss it in
> advance of committing your patch...
> 
> -> richard
> 
>>
>>>   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.
>>>>
>>>> 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,<ri...@apache.org>   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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>
> 

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/8/10 15:11, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>
>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>   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.
>>>
>> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>> sounds like it is intended to do exactly what you want, no?
>>
>> ->  richard
>>
>>
> No, I missed that point in the draft, thx for the pointer.  So what if I
> want to bring that into Felix Framework?
> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
> Would that work for everyone ?

Fine by me.

I imagine we could have figured this out if you tried to discuss it in 
advance of committing your patch...

-> richard

>
>>   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.
>>>
>>> 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,<ri...@apache.org>   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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>
>

Re: JAR URLs impl (was Re: [DISCUSS] Containerisms)

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 10:40, Guillaume Nodet wrote:
> On Mon, Oct 11, 2010 at 16:29, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/11/10 10:15, Guillaume Nodet wrote:
>>
>>> It helps me a bit because it gives me the basics for what I need.   What I
>>> really need is a way to have the useJarUlr() method returns always true
>>> (with a specific value for the org.apache.felix.jarurl dir), which I bet
>>> you
>>> won't let me to put that in.
>>>
>>> So , now, we implement some part of 4.3 draft and I can easily override
>>> the
>>> method and return what I need. Where's the problem here?
>>>
>> No problem. You just said it didn't help you, so I wondered if we could
>> remove it.
>>
>> BTW, why does m_jarUrl need to be a thread local?
>>
> Mostly because there's no easy way to pass along the fact that the
> getResource / getResources call comes from the OSGi API or from the module
> classloader.  My understanding of the draft is that only calls from the osgi
> classloader should be able to use jar urls, not those from the Bundle
> object.
> However, things are a bit intricated, especially if the call actually
> delagate to an imported package across another module.   I found that an
> easy way instead of having to change the whole api for just a hack ;-)

Ok, I see what you're doing. I'll have to think about that. I was 
wondering about that issue when I read the spec description too.

-> richard

>
>
>> ->  richard
>>
>>   On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>
>>>   wrote:
>>>
>>>    On 10/11/10 3:51, Guillaume Nodet wrote:
>>>>   I've committed the addition of the org.apache.felix.jarurls property,
>>>>> though
>>>>> after some testing, it does not really solve my problem anyway ...
>>>>> I've removed one "TODO: remove that when class path scanning is
>>>>> implemented"
>>>>> as the new method I added on the Module is necessary in order to
>>>>> implement
>>>>> this behavior.
>>>>>
>>>>>   Well, if it doesn't really help you, should we keep it at all? We're
>>>> not
>>>> required to implement it and it is a hack.
>>>>
>>>> ->   richard
>>>>
>>>>
>>>>   On Fri, Oct 8, 2010 at 21:22, Richard S. Hall<he...@ungoverned.org>
>>>>
>>>>>   wrote:
>>>>>
>>>>>
>>>>>   On 10/8/10 15:16, Guillaume Nodet wrote:
>>>>>>   On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>
>>>>>>
>>>>>>> wrote:
>>>>>>>
>>>>>>>
>>>>>>>   On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>>>>>>
>>>>>>>> wrote:
>>>>>>>>>     On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>>>>    On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fmeschbe@gmail.com
>>>>>>>>>    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.
>>>>>>>>>>
>>>>>>>>>>   BTW, are you familiar with org.osgi.framework.jarurls from
>>>>>>>>>> R4.3...this
>>>>>>>>>>
>>>>>>>>>>   sounds like it is intended to do exactly what you want, no?
>>>>>>>>> ->     richard
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   No, I missed that point in the draft, thx for the pointer.  So what
>>>>>>>>> if
>>>>>>>>>
>>>>>>>>>   I
>>>>>>>> want to bring that into Felix Framework?
>>>>>>>> I guess I'd have to use an "org.apache.felix.jarurls" property for
>>>>>>>> now
>>>>>>>> ?
>>>>>>>> Would that work for everyone ?
>>>>>>>>
>>>>>>>>
>>>>>>>>   Note that I don't really see how that would be different from what I
>>>>>>>>
>>>>>>>>   tried.
>>>>>>>   It's still a containerism until it's standardized (if it is ever) ...
>>>>>>>
>>>>>>>   Yeah, except we have it on pretty good authority that this is going
>>>>>>>
>>>>>> into
>>>>>> the spec. For example, we never started prototyping composite bundles
>>>>>> based
>>>>>> on the old proposed API, since it wasn't clear where it was going, but
>>>>>> once
>>>>>> things become more certain then that's a different story.
>>>>>>
>>>>>> And this property will still go away once the spec is final and may go
>>>>>> away
>>>>>> if it doesn't come to pass. This is the whole "provisional API"
>>>>>> discussion
>>>>>> again.
>>>>>>
>>>>>> And for the record, I was against this property during the spec
>>>>>> discussions
>>>>>> too.
>>>>>>
>>>>>> ->    richard
>>>>>>
>>>>>>
>>>>>>
>>>>>>     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.
>>>>>>>>>>
>>>>>>>>>> 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,<ri...@apache.org>      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
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>   --
>>>>>>>>>>>>>
>>>>>>>>>>>> Cheers,
>>>>>>>> Guillaume Nodet
>>>>>>>> ------------------------
>>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>>> ------------------------
>>>>>>>> Open Source SOA
>>>>>>>> http://fusesource.com
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>

Re: JAR URLs impl (was Re: [DISCUSS] Containerisms)

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Oct 11, 2010 at 16:29, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/11/10 10:15, Guillaume Nodet wrote:
>
>> It helps me a bit because it gives me the basics for what I need.   What I
>> really need is a way to have the useJarUlr() method returns always true
>> (with a specific value for the org.apache.felix.jarurl dir), which I bet
>> you
>> won't let me to put that in.
>>
>> So , now, we implement some part of 4.3 draft and I can easily override
>> the
>> method and return what I need. Where's the problem here?
>>
>
> No problem. You just said it didn't help you, so I wondered if we could
> remove it.
>
> BTW, why does m_jarUrl need to be a thread local?
>

Mostly because there's no easy way to pass along the fact that the
getResource / getResources call comes from the OSGi API or from the module
classloader.  My understanding of the draft is that only calls from the osgi
classloader should be able to use jar urls, not those from the Bundle
object.
However, things are a bit intricated, especially if the call actually
delagate to an imported package across another module.   I found that an
easy way instead of having to change the whole api for just a hack ;-)



>
> -> richard
>
>  On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>
>>  wrote:
>>
>>   On 10/11/10 3:51, Guillaume Nodet wrote:
>>>
>>>  I've committed the addition of the org.apache.felix.jarurls property,
>>>> though
>>>> after some testing, it does not really solve my problem anyway ...
>>>> I've removed one "TODO: remove that when class path scanning is
>>>> implemented"
>>>> as the new method I added on the Module is necessary in order to
>>>> implement
>>>> this behavior.
>>>>
>>>>  Well, if it doesn't really help you, should we keep it at all? We're
>>> not
>>> required to implement it and it is a hack.
>>>
>>> ->  richard
>>>
>>>
>>>  On Fri, Oct 8, 2010 at 21:22, Richard S. Hall<he...@ungoverned.org>
>>>
>>>>  wrote:
>>>>
>>>>
>>>>  On 10/8/10 15:16, Guillaume Nodet wrote:
>>>>>
>>>>>  On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>  On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>>>>>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>    On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>>>
>>>>>>>   On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fmeschbe@gmail.com
>>>>>>>> >
>>>>>>>>
>>>>>>>>   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.
>>>>>>>>>
>>>>>>>>>  BTW, are you familiar with org.osgi.framework.jarurls from
>>>>>>>>> R4.3...this
>>>>>>>>>
>>>>>>>>>  sounds like it is intended to do exactly what you want, no?
>>>>>>>>
>>>>>>>> ->    richard
>>>>>>>>
>>>>>>>>
>>>>>>>>  No, I missed that point in the draft, thx for the pointer.  So what
>>>>>>>> if
>>>>>>>>
>>>>>>>>  I
>>>>>>> want to bring that into Felix Framework?
>>>>>>> I guess I'd have to use an "org.apache.felix.jarurls" property for
>>>>>>> now
>>>>>>> ?
>>>>>>> Would that work for everyone ?
>>>>>>>
>>>>>>>
>>>>>>>  Note that I don't really see how that would be different from what I
>>>>>>>
>>>>>>>  tried.
>>>>>>  It's still a containerism until it's standardized (if it is ever) ...
>>>>>>
>>>>>>  Yeah, except we have it on pretty good authority that this is going
>>>>>>
>>>>> into
>>>>> the spec. For example, we never started prototyping composite bundles
>>>>> based
>>>>> on the old proposed API, since it wasn't clear where it was going, but
>>>>> once
>>>>> things become more certain then that's a different story.
>>>>>
>>>>> And this property will still go away once the spec is final and may go
>>>>> away
>>>>> if it doesn't come to pass. This is the whole "provisional API"
>>>>> discussion
>>>>> again.
>>>>>
>>>>> And for the record, I was against this property during the spec
>>>>> discussions
>>>>> too.
>>>>>
>>>>> ->   richard
>>>>>
>>>>>
>>>>>
>>>>>    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.
>>>>>>>>>
>>>>>>>>> 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,<ri...@apache.org>     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
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  --
>>>>>>>>>>>>
>>>>>>>>>>> Cheers,
>>>>>>> Guillaume Nodet
>>>>>>> ------------------------
>>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>>> ------------------------
>>>>>>> Open Source SOA
>>>>>>> http://fusesource.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

JAR URLs impl (was Re: [DISCUSS] Containerisms)

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 10:15, Guillaume Nodet wrote:
> It helps me a bit because it gives me the basics for what I need.   What I
> really need is a way to have the useJarUlr() method returns always true
> (with a specific value for the org.apache.felix.jarurl dir), which I bet you
> won't let me to put that in.
>
> So , now, we implement some part of 4.3 draft and I can easily override the
> method and return what I need. Where's the problem here?

No problem. You just said it didn't help you, so I wondered if we could 
remove it.

BTW, why does m_jarUrl need to be a thread local?

-> richard

> On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/11/10 3:51, Guillaume Nodet wrote:
>>
>>> I've committed the addition of the org.apache.felix.jarurls property,
>>> though
>>> after some testing, it does not really solve my problem anyway ...
>>> I've removed one "TODO: remove that when class path scanning is
>>> implemented"
>>> as the new method I added on the Module is necessary in order to implement
>>> this behavior.
>>>
>> Well, if it doesn't really help you, should we keep it at all? We're not
>> required to implement it and it is a hack.
>>
>> ->  richard
>>
>>
>>   On Fri, Oct 8, 2010 at 21:22, Richard S. Hall<he...@ungoverned.org>
>>>   wrote:
>>>
>>>
>>>> On 10/8/10 15:16, Guillaume Nodet wrote:
>>>>
>>>>   On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>
>>>>>   On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>>>>>> wrote:
>>>>>>>
>>>>>>    On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>>
>>>>>>>   On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>>>
>>>>>>>>   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.
>>>>>>>>
>>>>>>>>   BTW, are you familiar with org.osgi.framework.jarurls from
>>>>>>>> R4.3...this
>>>>>>>>
>>>>>>> sounds like it is intended to do exactly what you want, no?
>>>>>>>
>>>>>>> ->    richard
>>>>>>>
>>>>>>>
>>>>>>>   No, I missed that point in the draft, thx for the pointer.  So what
>>>>>>> if
>>>>>>>
>>>>>> I
>>>>>> want to bring that into Felix Framework?
>>>>>> I guess I'd have to use an "org.apache.felix.jarurls" property for now
>>>>>> ?
>>>>>> Would that work for everyone ?
>>>>>>
>>>>>>
>>>>>>   Note that I don't really see how that would be different from what I
>>>>>>
>>>>> tried.
>>>>>   It's still a containerism until it's standardized (if it is ever) ...
>>>>>
>>>>>   Yeah, except we have it on pretty good authority that this is going
>>>> into
>>>> the spec. For example, we never started prototyping composite bundles
>>>> based
>>>> on the old proposed API, since it wasn't clear where it was going, but
>>>> once
>>>> things become more certain then that's a different story.
>>>>
>>>> And this property will still go away once the spec is final and may go
>>>> away
>>>> if it doesn't come to pass. This is the whole "provisional API"
>>>> discussion
>>>> again.
>>>>
>>>> And for the record, I was against this property during the spec
>>>> discussions
>>>> too.
>>>>
>>>> ->   richard
>>>>
>>>>
>>>>
>>>>     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.
>>>>>>>>
>>>>>>>> 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,<ri...@apache.org>     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
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>   --
>>>>>> Cheers,
>>>>>> Guillaume Nodet
>>>>>> ------------------------
>>>>>> Blog: http://gnodet.blogspot.com/
>>>>>> ------------------------
>>>>>> Open Source SOA
>>>>>> http://fusesource.com
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
It helps me a bit because it gives me the basics for what I need.   What I
really need is a way to have the useJarUlr() method returns always true
(with a specific value for the org.apache.felix.jarurl dir), which I bet you
won't let me to put that in.

So , now, we implement some part of 4.3 draft and I can easily override the
method and return what I need. Where's the problem here?

On Mon, Oct 11, 2010 at 15:38, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/11/10 3:51, Guillaume Nodet wrote:
>
>> I've committed the addition of the org.apache.felix.jarurls property,
>> though
>> after some testing, it does not really solve my problem anyway ...
>> I've removed one "TODO: remove that when class path scanning is
>> implemented"
>> as the new method I added on the Module is necessary in order to implement
>> this behavior.
>>
>
> Well, if it doesn't really help you, should we keep it at all? We're not
> required to implement it and it is a hack.
>
> -> richard
>
>
>  On Fri, Oct 8, 2010 at 21:22, Richard S. Hall<he...@ungoverned.org>
>>  wrote:
>>
>>
>>> On 10/8/10 15:16, Guillaume Nodet wrote:
>>>
>>>  On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>
>>>> wrote:
>>>>
>>>>
>>>>  On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>
>>>>>>  On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>>
>>>>>>>  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.
>>>>>>>
>>>>>>>  BTW, are you familiar with org.osgi.framework.jarurls from
>>>>>>> R4.3...this
>>>>>>>
>>>>>> sounds like it is intended to do exactly what you want, no?
>>>>>>
>>>>>> ->   richard
>>>>>>
>>>>>>
>>>>>>  No, I missed that point in the draft, thx for the pointer.  So what
>>>>>> if
>>>>>>
>>>>> I
>>>>> want to bring that into Felix Framework?
>>>>> I guess I'd have to use an "org.apache.felix.jarurls" property for now
>>>>> ?
>>>>> Would that work for everyone ?
>>>>>
>>>>>
>>>>>  Note that I don't really see how that would be different from what I
>>>>>
>>>> tried.
>>>>  It's still a containerism until it's standardized (if it is ever) ...
>>>>
>>>>  Yeah, except we have it on pretty good authority that this is going
>>> into
>>> the spec. For example, we never started prototyping composite bundles
>>> based
>>> on the old proposed API, since it wasn't clear where it was going, but
>>> once
>>> things become more certain then that's a different story.
>>>
>>> And this property will still go away once the spec is final and may go
>>> away
>>> if it doesn't come to pass. This is the whole "provisional API"
>>> discussion
>>> again.
>>>
>>> And for the record, I was against this property during the spec
>>> discussions
>>> too.
>>>
>>> ->  richard
>>>
>>>
>>>
>>>    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.
>>>>>>>
>>>>>>> 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,<ri...@apache.org>    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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  --
>>>>> Cheers,
>>>>> Guillaume Nodet
>>>>> ------------------------
>>>>> Blog: http://gnodet.blogspot.com/
>>>>> ------------------------
>>>>> Open Source SOA
>>>>> http://fusesource.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 3:51, Guillaume Nodet wrote:
> I've committed the addition of the org.apache.felix.jarurls property, though
> after some testing, it does not really solve my problem anyway ...
> I've removed one "TODO: remove that when class path scanning is implemented"
> as the new method I added on the Module is necessary in order to implement
> this behavior.

Well, if it doesn't really help you, should we keep it at all? We're not 
required to implement it and it is a hack.

-> richard

> On Fri, Oct 8, 2010 at 21:22, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>
>> On 10/8/10 15:16, Guillaume Nodet wrote:
>>
>>> On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>   wrote:
>>>
>>>
>>>> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>>>> wrote:
>>>>    On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>   On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>>   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.
>>>>>>
>>>>>>   BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>>>>> sounds like it is intended to do exactly what you want, no?
>>>>>
>>>>> ->   richard
>>>>>
>>>>>
>>>>>   No, I missed that point in the draft, thx for the pointer.  So what if
>>>> I
>>>> want to bring that into Felix Framework?
>>>> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
>>>> Would that work for everyone ?
>>>>
>>>>
>>>>   Note that I don't really see how that would be different from what I
>>> tried.
>>>   It's still a containerism until it's standardized (if it is ever) ...
>>>
>> Yeah, except we have it on pretty good authority that this is going into
>> the spec. For example, we never started prototyping composite bundles based
>> on the old proposed API, since it wasn't clear where it was going, but once
>> things become more certain then that's a different story.
>>
>> And this property will still go away once the spec is final and may go away
>> if it doesn't come to pass. This is the whole "provisional API" discussion
>> again.
>>
>> And for the record, I was against this property during the spec discussions
>> too.
>>
>> ->  richard
>>
>>
>>
>>>    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.
>>>>>>
>>>>>> 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,<ri...@apache.org>    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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>> --
>>>> Cheers,
>>>> Guillaume Nodet
>>>> ------------------------
>>>> Blog: http://gnodet.blogspot.com/
>>>> ------------------------
>>>> Open Source SOA
>>>> http://fusesource.com
>>>>
>>>>
>>>>
>>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
I've committed the addition of the org.apache.felix.jarurls property, though
after some testing, it does not really solve my problem anyway ...
I've removed one "TODO: remove that when class path scanning is implemented"
as the new method I added on the Module is necessary in order to implement
this behavior.

On Fri, Oct 8, 2010 at 21:22, Richard S. Hall <he...@ungoverned.org> wrote:

>
>
> On 10/8/10 15:16, Guillaume Nodet wrote:
>
>> On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>  wrote:
>>
>>
>>> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<heavy@ungoverned.org
>>> >wrote:
>>>
>>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>
>>>>  On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>  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.
>>>>>
>>>>>  BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>>>> sounds like it is intended to do exactly what you want, no?
>>>>
>>>> ->  richard
>>>>
>>>>
>>>>  No, I missed that point in the draft, thx for the pointer.  So what if
>>> I
>>> want to bring that into Felix Framework?
>>> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
>>> Would that work for everyone ?
>>>
>>>
>>>  Note that I don't really see how that would be different from what I
>> tried.
>>  It's still a containerism until it's standardized (if it is ever) ...
>>
>
> Yeah, except we have it on pretty good authority that this is going into
> the spec. For example, we never started prototyping composite bundles based
> on the old proposed API, since it wasn't clear where it was going, but once
> things become more certain then that's a different story.
>
> And this property will still go away once the spec is final and may go away
> if it doesn't come to pass. This is the whole "provisional API" discussion
> again.
>
> And for the record, I was against this property during the spec discussions
> too.
>
> -> richard
>
>
>
>>   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.
>>>>>
>>>>> 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,<ri...@apache.org>   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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>>
>>>
>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.

On 10/8/10 15:16, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet<gn...@gmail.com>  wrote:
>
>>
>> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall<he...@ungoverned.org>wrote:
>>
>>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>
>>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>   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.
>>>>
>>> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>>> sounds like it is intended to do exactly what you want, no?
>>>
>>> ->  richard
>>>
>>>
>> No, I missed that point in the draft, thx for the pointer.  So what if I
>> want to bring that into Felix Framework?
>> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
>> Would that work for everyone ?
>>
>>
> Note that I don't really see how that would be different from what I tried.
>   It's still a containerism until it's standardized (if it is ever) ...

Yeah, except we have it on pretty good authority that this is going into 
the spec. For example, we never started prototyping composite bundles 
based on the old proposed API, since it wasn't clear where it was going, 
but once things become more certain then that's a different story.

And this property will still go away once the spec is final and may go 
away if it doesn't come to pass. This is the whole "provisional API" 
discussion again.

And for the record, I was against this property during the spec 
discussions too.

-> richard

>
>>>   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.
>>>>
>>>> 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,<ri...@apache.org>   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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>>
>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Fri, Oct 8, 2010 at 21:11, Guillaume Nodet <gn...@gmail.com> wrote:

>
>
> On Fri, Oct 8, 2010 at 20:41, Richard S. Hall <he...@ungoverned.org>wrote:
>
>>  On 10/8/10 14:08, Guillaume Nodet wrote:
>>
>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>  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.
>>>
>>
>> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
>> sounds like it is intended to do exactly what you want, no?
>>
>> -> richard
>>
>>
> No, I missed that point in the draft, thx for the pointer.  So what if I
> want to bring that into Felix Framework?
> I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
> Would that work for everyone ?
>
>

Note that I don't really see how that would be different from what I tried.
 It's still a containerism until it's standardized (if it is ever) ...


>
>>  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.
>>>
>>> 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,<ri...@apache.org>  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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>>>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Fri, Oct 8, 2010 at 20:41, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/8/10 14:08, Guillaume Nodet wrote:
>
>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>  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.
>>
>
> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
> sounds like it is intended to do exactly what you want, no?
>
> -> richard
>
>
No, I missed that point in the draft, thx for the pointer.  So what if I
want to bring that into Felix Framework?
I guess I'd have to use an "org.apache.felix.jarurls" property for now ?
Would that work for everyone ?


>
>  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.
>>
>> 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,<ri...@apache.org>  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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by Karl Pauls <ka...@gmail.com>.
First of all, I do agree that we should try to a avoid containerisms.

That said, I don't even think one would need to fork the framework to
provide something like this. It could be implemented as an extension
bundle that makes the functionality available via a service or
something. That way it would be possible to implement the feature for
other frameworks as well if required. Obviously, that implies that if
we change stuff inside the framework the extension bundle will have to
adapt but at least this way the burden is not pushed on the framework.
A good example is the security provider which I implemented that way
and now all i have to do is to adapt it whenever framework internals I
depend upon change. Just an idea.

regards,

Karl

On Fri, Oct 8, 2010 at 8:41 PM, Richard S. Hall <he...@ungoverned.org> wrote:
>  On 10/8/10 14:08, Guillaume Nodet wrote:
>>
>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>  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.
>
> BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this
> sounds like it is intended to do exactly what you want, no?
>
> -> richard
>
>> 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.
>>
>> 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,<ri...@apache.org>  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
>>>>>
>>>>>
>>>>>
>>>>
>>
>>
>



-- 
Karl Pauls
karlpauls@gmail.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/8/10 14:08, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>  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.

BTW, are you familiar with org.osgi.framework.jarurls from R4.3...this 
sounds like it is intended to do exactly what you want, no?

-> richard

> 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.
>
> 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,<ri...@apache.org>  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
>>>>
>>>>
>>>>
>>>
>
>

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.

On 10/9/10 9:08, Felix Meschberger wrote:
> Hi,
>
> On 08.10.2010 20:08, Guillaume Nodet wrote:
>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>  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 ....

I tend to agree with you, Felix, but I'm not sure if it is an issue with 
Java EE specs or just how people chose to implement them and now they 
want those implementations to work "as is" in a modular world. The end 
result is that the OSGi specs get uglier and uglier.

-> richard

> 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,<ri...@apache.org>  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
>>>>>
>>>>>
>>>>>
>>>>
>>
>>

Re: [DISCUSS] Containerisms

Posted by Sanjeeb Sahoo <Sa...@Sun.COM>.
On Saturday 09 October 2010 06:38 PM, Felix Meschberger wrote:
> Hi,
>
> On 08.10.2010 20:08, Guillaume Nodet wrote:
>    
>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>  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 ?
>
>    
I tend to agree that with some knowledge of how OSGi treats 
Bundle-ClassPath entries, one can implement scanning using Bundle APIs 
like the one pointed out by Felix and the code should run fine all 
frameworks.
>> 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 ...
>
>    

I don't think Java EE specs are that bad that OSGi frameworks have to 
provide all sorts of nasty features to support Java EE APIs in an OSGi 
environment. I can't recall using any Felix feature to implement OSGi/EE 
specs in GlassFish project [1].

Thanks,
Sahoo

Re: [DISCUSS] Containerisms

Posted by Peter Kriens <pe...@aqute.biz>.
I am really happy you guys worked out a solution that would not create containerisms. I just worked with SQL and have seen what happens when implementations try to lock you in. I would hate to see OSGi go in that direction.

Kind regards,

	Peter Kriens







On 9 okt 2010, at 22:22, Guillaume Nodet wrote:

> I'm not necessarily talking about JEE here, but on all the projects i've
> worked on, implementing a standard does not always mean you can't innovate
> and go beyond what the standard provides.   When you develop an application,
> it's nice to adhere to a standard for a lot of reasons, but as a developer,
> if you need to use a specific feature of the container you'll deploy to be
> able to finish your project, you'll just do it.  You know you'll be locked
> into that container or product, but usually, it does not matter so much as i
> have hardly seen people switching any product they use when you have
> evaluated, tested an environment.  And even if you need to, if the feature
> you need is outside the spec, you'll try another workaround if you have to
> switch.
> 
> Karl, you took the example of the security framework, but the implementation
> is pretty much tied to the framework, so not maintaining that in the
> same project and having no public api has imho more drawbacks than
> advantages, because any change in the framework (given there's no public api
> really beyong the osgi api) can pretty much brake the security project.  In
> that case, you need to adapt the security and/or the framework to make that
> work again.   Of course, it makes Rick work easier because the framework can
> be refactored at will, while it makes your life harder.
> 
> Felix, I don't think the OSGi specs purity is twisted by JEE considerations.
> It's just that the whole JEE world bring new important use cases that
> haven't been addressed in the past (annotation scanning, classpath scanning,
> load time weaving, etc...)  Those are problems the mobile environment
> usually don't have afaik.  Some of the solutions enable more use cases
> (registry hooks, resolver hooks, virtual bundles, etc...).
> 
> Anyway, it's just my view and I have no problem to agree we disagree on it
> ...
> 
> On Sat, Oct 9, 2010 at 15:08, Felix Meschberger <fm...@gmail.com> wrote:
> 
>> Hi,
>> 
>> On 08.10.2010 20:08, Guillaume Nodet wrote:
>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger <fm...@gmail.com>
>> 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, <ri...@apache.org> 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
>>>>>> 
>>>>>> 
>>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> 
>>> 
>> 
> 
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com


Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
I'm not necessarily talking about JEE here, but on all the projects i've
worked on, implementing a standard does not always mean you can't innovate
and go beyond what the standard provides.   When you develop an application,
it's nice to adhere to a standard for a lot of reasons, but as a developer,
if you need to use a specific feature of the container you'll deploy to be
able to finish your project, you'll just do it.  You know you'll be locked
into that container or product, but usually, it does not matter so much as i
have hardly seen people switching any product they use when you have
evaluated, tested an environment.  And even if you need to, if the feature
you need is outside the spec, you'll try another workaround if you have to
switch.

Karl, you took the example of the security framework, but the implementation
is pretty much tied to the framework, so not maintaining that in the
same project and having no public api has imho more drawbacks than
advantages, because any change in the framework (given there's no public api
really beyong the osgi api) can pretty much brake the security project.  In
that case, you need to adapt the security and/or the framework to make that
work again.   Of course, it makes Rick work easier because the framework can
be refactored at will, while it makes your life harder.

Felix, I don't think the OSGi specs purity is twisted by JEE considerations.
 It's just that the whole JEE world bring new important use cases that
haven't been addressed in the past (annotation scanning, classpath scanning,
load time weaving, etc...)  Those are problems the mobile environment
usually don't have afaik.  Some of the solutions enable more use cases
(registry hooks, resolver hooks, virtual bundles, etc...).

Anyway, it's just my view and I have no problem to agree we disagree on it
...

On Sat, Oct 9, 2010 at 15:08, Felix Meschberger <fm...@gmail.com> wrote:

> Hi,
>
> On 08.10.2010 20:08, Guillaume Nodet wrote:
> > On Fri, Oct 8, 2010 at 18:43, Felix Meschberger <fm...@gmail.com>
> 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, <ri...@apache.org> 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
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
> >
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

On 08.10.2010 20:08, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger <fm...@gmail.com> 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, <ri...@apache.org> 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
>>>>
>>>>
>>>>
>>>
>>>
>>
> 
> 
> 

Re: [DISCUSS] Containerisms

Posted by Guo Du <mr...@duguo.org>.
On Mon, Oct 11, 2010 at 4:07 PM, Guillaume Nodet <gn...@gmail.com> wrote:
> And I do think the OSGi api is *the* Felix framework public api.
It's valid for NORMAL OSGi users who suppose to not code only for Felix.

It is also valid to have Felix specify api to let ADVANCED user to
take more control of the framework behavior. The api will promote user
to extend Felix properly for the use case mentioned already:
caching/class loading/resource loading/aop/managing.

I saw the similar approach applied on JCR/Jackrabbit project. It have
JCR public api and also jackrabbit-api.

-Guo

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Oct 11, 2010 at 16:50, Richard S. Hall <he...@ungoverned.org> wrote:

>
>
<snipped for shortness>
>
>
>  I assume you are not equating getting real URLs with innovation, because
>>> to
>>> me it is just a hack even if/when it becomes standardized.
>>>
>>>
>>>  That's very true and I agree to call that a hack.  Our disagreement
>> comes
>> from that fact that I think hacks can be enablers and are not necessarily
>> evils.
>>
>
> I would tend to agree if it weren't for the fact that a) we are never
> allowed to get rid of the hacks and b) people continue to create
> dependencies on the hacks because they're familiar with it.
>

I don't think we can't get rids of hacks, though I do think we need to
provide a similar way to solve the same problem.  If the problem exists, I
think we should give a solution for it (then the question is wether you
consider the problem valid or not obviously and I guess that's where the
difference kicks in).    If at some point, there's a better way (or
standardized way) to do something, I don't feel compelled to maintain that
custom hack forever.
And I do think the OSGi api is *the* Felix framework public api.



>
> -> richard
>
> <snipped for shortness>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 10:36, Guillaume Nodet wrote:
> On Mon, Oct 11, 2010 at 16:25, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/11/10 10:05, Guillaume Nodet wrote:
>>
>>> On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>
>>>   wrote:
>>>
>>>    On 10/11/10 3:32, Guillaume Nodet wrote:
>>>>   What I don't get is why we don't get rid of the existing containerims in
>>>>> Felix:
>>>>>    * the reference: and inputstream: url protocol for installing bundles
>>>>>
>>>>>   There is no inputstream: URL for installing bundles. The reference: URL
>>>> is
>>>> there largely because Equinox has it and it was created specifically to
>>>> match their containerism.
>>>>
>>>>   Right, the inputstream stuff seems like an internal way to pass a
>>> parameter.
>>>   I may be wrong, but I guess it could be removed alltogether by simply
>>> checking if the input stream parameter is null  in
>>> BundleArchive#createRevisionFromLocation ...
>>>
>> Yeah, possibly. I'd have to look at it.
>>
>>
>>      * the pluggable cache
>>>> We could. I'm not aware of anyone using it. But in reality, I'd like to
>>>> find a completely different way to handle the cache. Making it pluggable
>>>> is
>>>> only good design, since it allows us to change our own implementation
>>>> too.
>>>>
>>>>
>>>      * implicit boot delegation
>>>> This isn't really a containerism as much as it is trying to faithfully
>>>> implement the spec. It tries to workaround stupid assumptions in the JRE.
>>>>
>>> Out of curiosity, why can it be disabled then if the purpose is to be
>>> close
>>> to the spec?
>>>
>> We added the ability to disable it not that long ago, but we affectionately
>> refer to as the "magic hack" has existed for many years. We allow you to
>> disable it because it is a best effort to approximate the spec, but it is
>> not 100% correct, therefore you can disable it if it is causing you some
>> difficulty. However, we've tried to constantly evolve it over time to
>> incorporate more failing use cases as we uncover them. So, I'd expect the
>> need to disable it continues to shrink.
>>
>>
>>
>>>>   I suppose there are some more hidden throughout the code.
>>>> Probably, but given this list, it looks like we're doing a pretty good
>>>> job.
>>>>
>>>> As I said in another message, we look at everything on a case-by-case
>>>> basis. There is no blanket answer, but typically things that break
>>>> abstractions or encapsulation will be frowned upon.
>>>>
>>>> Certainly there are places were we have container-specific behavior, but
>>>> it
>>>> is often due to leeway in the spec. In other cases, I can almost assure
>>>> you
>>>> that I discuss them with Tom Watson to make sure we can align such areas
>>>> if
>>>> possible.
>>>>
>>>>   Yeah, I can see the purpose of trying to not introduce containerism, but
>>> can't at the same time oppose to any change in the spec and oppose to any
>>> containerism.   Users have some needs and there must be a way for Felix to
>>> fullfill those.
>>>
>>> What I don't get is why can't Felix Framework be a source of innovation
>>> for
>>> solving real problems in OSGi, like AOP or such.   You can't certainly
>>> believe the OSGi spec is perfect and that all use cases have been
>>> addressed,
>>> else it would not evolve anymore.  Having to wait 2 years for the OSGi
>>> alliance for publish an update to the spec, then 6 months for Felix to
>>> implement and release it  isn't really a good solution for Felix users.
>>>
>> Again, we are willing to look at anything. Where do you think the standard
>> launching and embedding API came from in R4.2? You should've seen the
>> Virtual Bundle stuff I was cooking up before it was shelved. If you have a
>> proposal for some great way to do AOP in a modular way, I'd definitely like
>> to hear it. (Especially given the not so great byte code weaving RFC.)
>>
> I'm aware of the virtual bundles thing you've done.  I just find given it's
> in a private unreleased branch and only a handful of people are aware of it,
> it's hard to gather real use feedback on that, but i'm actually planning to
> have a look at those in the coming weeks and implement a vb manager.

Well, for now it has been put on the back burner, if not permanently 
shelved. There might still be some good ideas in there, but I'm not sure 
what to do with it anymore. I think there are some issues that would 
need to be improved for it to really be what we need. Specifically, I 
think we need to think of some way to allow there to be multiple 
managers per bundle...if that even makes sense.

> I guess i'm more an agile kind of developer, and i tend to prefer releasing
> something even if not fully functional to gather feedback, even if this
> means having to refactor things later.  Those kind of features are really
> those that the average osgi users won't use (at least directly), so i don't
> necessarily feel bound to an api forever.   For virtual bundles, the use
> case is real, so even if people have to rewrite things a bit when they
> upgrade from felix 3.1 to 3.2, having such a feature in trunk would seem to
> me a really nice thing.

I would have likely released it if I knew for sure it was "the" 
direction to go. At this point, I'm not sure, although I really do like 
aspects of it. I was toying with the idea of making the behavior of a 
bundle implemented as a vb manager, so the core would be more of a 
generic module system...largely just the resolver. Would be kind of 
cool, but as I said above, there are other issues that would be more 
important to resolve.

>> I assume you are not equating getting real URLs with innovation, because to
>> me it is just a hack even if/when it becomes standardized.
>>
>>
> That's very true and I agree to call that a hack.  Our disagreement comes
> from that fact that I think hacks can be enablers and are not necessarily
> evils.

I would tend to agree if it weren't for the fact that a) we are never 
allowed to get rid of the hacks and b) people continue to create 
dependencies on the hacks because they're familiar with it.

-> richard

>
>>   My original problem isn't really solved by the jarurl dir (if implemented
>>> as
>>> drafted, meaning that Bundle#getResource.
>>> I've been pointed to the Wiring#listResources() in the 4.3 draft which is
>>> closer to my needs actually, but that looks like a much bigger work.
>>>
>> Yeah, tell me about it. I'm not looking forward to it. Originally, that was
>> planned to be outside the framework, which I thought was a great idea. ;-)
>>
>> ->  richard
>>
>>
>>
>>>
>>>
>>>   ->   richard
>>>>
>>>>   On Fri, Oct 8, 2010 at 20:17, Richard S. Hall<he...@ungoverned.org>
>>>>
>>>>>   wrote:
>>>>>
>>>>>    On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>>
>>>>>>   On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>>
>>>>>>>   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.
>>>>>>>
>>>>>>> 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.
>>>>>>>
>>>>>>> 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.
>>>>>>>
>>>>>>>   Which is precisely the point from my perspective. Not only do you
>>>>>>> want
>>>>>>>
>>>>>> the
>>>>>> hack, but you want it maintained forever. That's precisely what I think
>>>>>> we
>>>>>> should avoid.
>>>>>>
>>>>>> If you are keen on having your own custom version of Felix, we can
>>>>>> always
>>>>>> start a new subproject so you can work on one that you think is better.
>>>>>> It
>>>>>> doesn't bother me to have two framework impls...as I've said many
>>>>>> times,
>>>>>> the
>>>>>> framework is just a subproject like any other. Just create a fork and
>>>>>> call
>>>>>> it something completely different so there is no confusion.
>>>>>>
>>>>>> ->    richard
>>>>>>
>>>>>>
>>>>>>
>>>>>>    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,<ri...@apache.org>     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
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Oct 11, 2010 at 16:25, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/11/10 10:05, Guillaume Nodet wrote:
>
>> On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>
>>  wrote:
>>
>>   On 10/11/10 3:32, Guillaume Nodet wrote:
>>>
>>>  What I don't get is why we don't get rid of the existing containerims in
>>>> Felix:
>>>>   * the reference: and inputstream: url protocol for installing bundles
>>>>
>>>>  There is no inputstream: URL for installing bundles. The reference: URL
>>> is
>>> there largely because Equinox has it and it was created specifically to
>>> match their containerism.
>>>
>>>  Right, the inputstream stuff seems like an internal way to pass a
>> parameter.
>>  I may be wrong, but I guess it could be removed alltogether by simply
>> checking if the input stream parameter is null  in
>> BundleArchive#createRevisionFromLocation ...
>>
>
> Yeah, possibly. I'd have to look at it.
>
>
>     * the pluggable cache
>>> We could. I'm not aware of anyone using it. But in reality, I'd like to
>>> find a completely different way to handle the cache. Making it pluggable
>>> is
>>> only good design, since it allows us to change our own implementation
>>> too.
>>>
>>>
>>     * implicit boot delegation
>>> This isn't really a containerism as much as it is trying to faithfully
>>> implement the spec. It tries to workaround stupid assumptions in the JRE.
>>>
>>
>> Out of curiosity, why can it be disabled then if the purpose is to be
>> close
>> to the spec?
>>
>
> We added the ability to disable it not that long ago, but we affectionately
> refer to as the "magic hack" has existed for many years. We allow you to
> disable it because it is a best effort to approximate the spec, but it is
> not 100% correct, therefore you can disable it if it is causing you some
> difficulty. However, we've tried to constantly evolve it over time to
> incorporate more failing use cases as we uncover them. So, I'd expect the
> need to disable it continues to shrink.
>
>
>
>>>  I suppose there are some more hidden throughout the code.
>>> Probably, but given this list, it looks like we're doing a pretty good
>>> job.
>>>
>>> As I said in another message, we look at everything on a case-by-case
>>> basis. There is no blanket answer, but typically things that break
>>> abstractions or encapsulation will be frowned upon.
>>>
>>> Certainly there are places were we have container-specific behavior, but
>>> it
>>> is often due to leeway in the spec. In other cases, I can almost assure
>>> you
>>> that I discuss them with Tom Watson to make sure we can align such areas
>>> if
>>> possible.
>>>
>>>  Yeah, I can see the purpose of trying to not introduce containerism, but
>> can't at the same time oppose to any change in the spec and oppose to any
>> containerism.   Users have some needs and there must be a way for Felix to
>> fullfill those.
>>
>> What I don't get is why can't Felix Framework be a source of innovation
>> for
>> solving real problems in OSGi, like AOP or such.   You can't certainly
>> believe the OSGi spec is perfect and that all use cases have been
>> addressed,
>> else it would not evolve anymore.  Having to wait 2 years for the OSGi
>> alliance for publish an update to the spec, then 6 months for Felix to
>> implement and release it  isn't really a good solution for Felix users.
>>
>
> Again, we are willing to look at anything. Where do you think the standard
> launching and embedding API came from in R4.2? You should've seen the
> Virtual Bundle stuff I was cooking up before it was shelved. If you have a
> proposal for some great way to do AOP in a modular way, I'd definitely like
> to hear it. (Especially given the not so great byte code weaving RFC.)
>

I'm aware of the virtual bundles thing you've done.  I just find given it's
in a private unreleased branch and only a handful of people are aware of it,
it's hard to gather real use feedback on that, but i'm actually planning to
have a look at those in the coming weeks and implement a vb manager.

I guess i'm more an agile kind of developer, and i tend to prefer releasing
something even if not fully functional to gather feedback, even if this
means having to refactor things later.  Those kind of features are really
those that the average osgi users won't use (at least directly), so i don't
necessarily feel bound to an api forever.   For virtual bundles, the use
case is real, so even if people have to rewrite things a bit when they
upgrade from felix 3.1 to 3.2, having such a feature in trunk would seem to
me a really nice thing.


>
> I assume you are not equating getting real URLs with innovation, because to
> me it is just a hack even if/when it becomes standardized.
>
>
That's very true and I agree to call that a hack.  Our disagreement comes
from that fact that I think hacks can be enablers and are not necessarily
evils.


>
>  My original problem isn't really solved by the jarurl dir (if implemented
>> as
>> drafted, meaning that Bundle#getResource.
>> I've been pointed to the Wiring#listResources() in the 4.3 draft which is
>> closer to my needs actually, but that looks like a much bigger work.
>>
>
> Yeah, tell me about it. I'm not looking forward to it. Originally, that was
> planned to be outside the framework, which I thought was a great idea. ;-)
>
> -> richard
>
>
>
>>
>>
>>
>>  ->  richard
>>>
>>>
>>>  On Fri, Oct 8, 2010 at 20:17, Richard S. Hall<he...@ungoverned.org>
>>>
>>>>  wrote:
>>>>
>>>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>
>>>>>  On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>
>>>>>>  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.
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>> 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.
>>>>>>
>>>>>>  Which is precisely the point from my perspective. Not only do you
>>>>>> want
>>>>>>
>>>>> the
>>>>> hack, but you want it maintained forever. That's precisely what I think
>>>>> we
>>>>> should avoid.
>>>>>
>>>>> If you are keen on having your own custom version of Felix, we can
>>>>> always
>>>>> start a new subproject so you can work on one that you think is better.
>>>>> It
>>>>> doesn't bother me to have two framework impls...as I've said many
>>>>> times,
>>>>> the
>>>>> framework is just a subproject like any other. Just create a fork and
>>>>> call
>>>>> it something completely different so there is no confusion.
>>>>>
>>>>> ->   richard
>>>>>
>>>>>
>>>>>
>>>>>   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,<ri...@apache.org>    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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 10:05, Guillaume Nodet wrote:
> On Mon, Oct 11, 2010 at 15:38, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/11/10 3:32, Guillaume Nodet wrote:
>>
>>> What I don't get is why we don't get rid of the existing containerims in
>>> Felix:
>>>    * the reference: and inputstream: url protocol for installing bundles
>>>
>> There is no inputstream: URL for installing bundles. The reference: URL is
>> there largely because Equinox has it and it was created specifically to
>> match their containerism.
>>
> Right, the inputstream stuff seems like an internal way to pass a parameter.
>   I may be wrong, but I guess it could be removed alltogether by simply
> checking if the input stream parameter is null  in
> BundleArchive#createRevisionFromLocation ...

Yeah, possibly. I'd have to look at it.

>>     * the pluggable cache
>> We could. I'm not aware of anyone using it. But in reality, I'd like to
>> find a completely different way to handle the cache. Making it pluggable is
>> only good design, since it allows us to change our own implementation too.
>>
>
>>     * implicit boot delegation
>> This isn't really a containerism as much as it is trying to faithfully
>> implement the spec. It tries to workaround stupid assumptions in the JRE.
>
> Out of curiosity, why can it be disabled then if the purpose is to be close
> to the spec?

We added the ability to disable it not that long ago, but we 
affectionately refer to as the "magic hack" has existed for many years. 
We allow you to disable it because it is a best effort to approximate 
the spec, but it is not 100% correct, therefore you can disable it if it 
is causing you some difficulty. However, we've tried to constantly 
evolve it over time to incorporate more failing use cases as we uncover 
them. So, I'd expect the need to disable it continues to shrink.

>>
>>   I suppose there are some more hidden throughout the code.
>> Probably, but given this list, it looks like we're doing a pretty good job.
>>
>> As I said in another message, we look at everything on a case-by-case
>> basis. There is no blanket answer, but typically things that break
>> abstractions or encapsulation will be frowned upon.
>>
>> Certainly there are places were we have container-specific behavior, but it
>> is often due to leeway in the spec. In other cases, I can almost assure you
>> that I discuss them with Tom Watson to make sure we can align such areas if
>> possible.
>>
> Yeah, I can see the purpose of trying to not introduce containerism, but
> can't at the same time oppose to any change in the spec and oppose to any
> containerism.   Users have some needs and there must be a way for Felix to
> fullfill those.
>
> What I don't get is why can't Felix Framework be a source of innovation for
> solving real problems in OSGi, like AOP or such.   You can't certainly
> believe the OSGi spec is perfect and that all use cases have been addressed,
> else it would not evolve anymore.  Having to wait 2 years for the OSGi
> alliance for publish an update to the spec, then 6 months for Felix to
> implement and release it  isn't really a good solution for Felix users.

Again, we are willing to look at anything. Where do you think the 
standard launching and embedding API came from in R4.2? You should've 
seen the Virtual Bundle stuff I was cooking up before it was shelved. If 
you have a proposal for some great way to do AOP in a modular way, I'd 
definitely like to hear it. (Especially given the not so great byte code 
weaving RFC.)

I assume you are not equating getting real URLs with innovation, because 
to me it is just a hack even if/when it becomes standardized.

> My original problem isn't really solved by the jarurl dir (if implemented as
> drafted, meaning that Bundle#getResource.
> I've been pointed to the Wiring#listResources() in the 4.3 draft which is
> closer to my needs actually, but that looks like a much bigger work.

Yeah, tell me about it. I'm not looking forward to it. Originally, that 
was planned to be outside the framework, which I thought was a great 
idea. ;-)

-> richard

>
>
>
>
>> ->  richard
>>
>>
>>   On Fri, Oct 8, 2010 at 20:17, Richard S. Hall<he...@ungoverned.org>
>>>   wrote:
>>>
>>>    On 10/8/10 14:08, Guillaume Nodet wrote:
>>>>   On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>>   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.
>>>>>
>>>>> 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.
>>>>>
>>>>> 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.
>>>>>
>>>>>   Which is precisely the point from my perspective. Not only do you want
>>>> the
>>>> hack, but you want it maintained forever. That's precisely what I think
>>>> we
>>>> should avoid.
>>>>
>>>> If you are keen on having your own custom version of Felix, we can always
>>>> start a new subproject so you can work on one that you think is better.
>>>> It
>>>> doesn't bother me to have two framework impls...as I've said many times,
>>>> the
>>>> framework is just a subproject like any other. Just create a fork and
>>>> call
>>>> it something completely different so there is no confusion.
>>>>
>>>> ->   richard
>>>>
>>>>
>>>>
>>>>    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,<ri...@apache.org>    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
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Mon, Oct 11, 2010 at 15:38, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/11/10 3:32, Guillaume Nodet wrote:
>
>> What I don't get is why we don't get rid of the existing containerims in
>> Felix:
>>   * the reference: and inputstream: url protocol for installing bundles
>>
>
> There is no inputstream: URL for installing bundles. The reference: URL is
> there largely because Equinox has it and it was created specifically to
> match their containerism.
>

Right, the inputstream stuff seems like an internal way to pass a parameter.
 I may be wrong, but I guess it could be removed alltogether by simply
checking if the input stream parameter is null  in
BundleArchive#createRevisionFromLocation ...


>
>    * the pluggable cache
>>
>
> We could. I'm not aware of anyone using it. But in reality, I'd like to
> find a completely different way to handle the cache. Making it pluggable is
> only good design, since it allows us to change our own implementation too.
>


>
>    * implicit boot delegation
>>
>
> This isn't really a containerism as much as it is trying to faithfully
> implement the spec. It tries to workaround stupid assumptions in the JRE.


Out of curiosity, why can it be disabled then if the purpose is to be close
to the spec?


>
>
>  I suppose there are some more hidden throughout the code.
>>
>
> Probably, but given this list, it looks like we're doing a pretty good job.
>
> As I said in another message, we look at everything on a case-by-case
> basis. There is no blanket answer, but typically things that break
> abstractions or encapsulation will be frowned upon.
>
> Certainly there are places were we have container-specific behavior, but it
> is often due to leeway in the spec. In other cases, I can almost assure you
> that I discuss them with Tom Watson to make sure we can align such areas if
> possible.
>

Yeah, I can see the purpose of trying to not introduce containerism, but
can't at the same time oppose to any change in the spec and oppose to any
containerism.   Users have some needs and there must be a way for Felix to
fullfill those.

What I don't get is why can't Felix Framework be a source of innovation for
solving real problems in OSGi, like AOP or such.   You can't certainly
believe the OSGi spec is perfect and that all use cases have been addressed,
else it would not evolve anymore.  Having to wait 2 years for the OSGi
alliance for publish an update to the spec, then 6 months for Felix to
implement and release it  isn't really a good solution for Felix users.

My original problem isn't really solved by the jarurl dir (if implemented as
drafted, meaning that Bundle#getResource.
I've been pointed to the Wiring#listResources() in the 4.3 draft which is
closer to my needs actually, but that looks like a much bigger work.





>
> -> richard
>
>
>  On Fri, Oct 8, 2010 at 20:17, Richard S. Hall<he...@ungoverned.org>
>>  wrote:
>>
>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>>
>>>  On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>>  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.
>>>>
>>>> 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.
>>>>
>>>> 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.
>>>>
>>>>  Which is precisely the point from my perspective. Not only do you want
>>> the
>>> hack, but you want it maintained forever. That's precisely what I think
>>> we
>>> should avoid.
>>>
>>> If you are keen on having your own custom version of Felix, we can always
>>> start a new subproject so you can work on one that you think is better.
>>> It
>>> doesn't bother me to have two framework impls...as I've said many times,
>>> the
>>> framework is just a subproject like any other. Just create a fork and
>>> call
>>> it something completely different so there is no confusion.
>>>
>>> ->  richard
>>>
>>>
>>>
>>>   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,<ri...@apache.org>   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
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/11/10 3:32, Guillaume Nodet wrote:
> What I don't get is why we don't get rid of the existing containerims in
> Felix:
>    * the reference: and inputstream: url protocol for installing bundles

There is no inputstream: URL for installing bundles. The reference: URL 
is there largely because Equinox has it and it was created specifically 
to match their containerism.

>    * the pluggable cache

We could. I'm not aware of anyone using it. But in reality, I'd like to 
find a completely different way to handle the cache. Making it pluggable 
is only good design, since it allows us to change our own implementation 
too.

>    * implicit boot delegation

This isn't really a containerism as much as it is trying to faithfully 
implement the spec. It tries to workaround stupid assumptions in the JRE.

> I suppose there are some more hidden throughout the code.

Probably, but given this list, it looks like we're doing a pretty good job.

As I said in another message, we look at everything on a case-by-case 
basis. There is no blanket answer, but typically things that break 
abstractions or encapsulation will be frowned upon.

Certainly there are places were we have container-specific behavior, but 
it is often due to leeway in the spec. In other cases, I can almost 
assure you that I discuss them with Tom Watson to make sure we can align 
such areas if possible.

-> richard

> On Fri, Oct 8, 2010 at 20:17, Richard S. Hall<he...@ungoverned.org>  wrote:
>
>>   On 10/8/10 14:08, Guillaume Nodet wrote:
>>
>>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>>   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.
>>>
>>> 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.
>>>
>>> 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.
>>>
>> Which is precisely the point from my perspective. Not only do you want the
>> hack, but you want it maintained forever. That's precisely what I think we
>> should avoid.
>>
>> If you are keen on having your own custom version of Felix, we can always
>> start a new subproject so you can work on one that you think is better. It
>> doesn't bother me to have two framework impls...as I've said many times, the
>> framework is just a subproject like any other. Just create a fork and call
>> it something completely different so there is no confusion.
>>
>> ->  richard
>>
>>
>>
>>>   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,<ri...@apache.org>   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
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
What I don't get is why we don't get rid of the existing containerims in
Felix:
  * the reference: and inputstream: url protocol for installing bundles
  * the pluggable cache
  * implicit boot delegation
I suppose there are some more hidden throughout the code.

On Fri, Oct 8, 2010 at 20:17, Richard S. Hall <he...@ungoverned.org> wrote:

>  On 10/8/10 14:08, Guillaume Nodet wrote:
>
>> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>
>>  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.
>>
>> 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.
>>
>> 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.
>>
>
> Which is precisely the point from my perspective. Not only do you want the
> hack, but you want it maintained forever. That's precisely what I think we
> should avoid.
>
> If you are keen on having your own custom version of Felix, we can always
> start a new subproject so you can work on one that you think is better. It
> doesn't bother me to have two framework impls...as I've said many times, the
> framework is just a subproject like any other. Just create a fork and call
> it something completely different so there is no confusion.
>
> -> richard
>
>
>
>>  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,<ri...@apache.org>  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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>
>>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by "Richard S. Hall" <he...@ungoverned.org>.
  On 10/8/10 14:08, Guillaume Nodet wrote:
> On Fri, Oct 8, 2010 at 18:43, Felix Meschberger<fm...@gmail.com>  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.
>
> 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.
>
> 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.

Which is precisely the point from my perspective. Not only do you want 
the hack, but you want it maintained forever. That's precisely what I 
think we should avoid.

If you are keen on having your own custom version of Felix, we can 
always start a new subproject so you can work on one that you think is 
better. It doesn't bother me to have two framework impls...as I've said 
many times, the framework is just a subproject like any other. Just 
create a fork and call it something completely different so there is no 
confusion.

-> richard

>
>> 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,<ri...@apache.org>  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
>>>>
>>>>
>>>>
>>>
>
>

Re: [DISCUSS] Containerisms

Posted by Guillaume Nodet <gn...@gmail.com>.
On Fri, Oct 8, 2010 at 18:43, Felix Meschberger <fm...@gmail.com> 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.

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.

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, <ri...@apache.org> 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
> >>
> >>
> >>
> >
> >
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: [DISCUSS] Containerisms

Posted by Felix Meschberger <fm...@gmail.com>.
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.

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, <ri...@apache.org> 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
>>
>>
>>
> 
>