[ 
https://issues.apache.org/jira/browse/MYFACES-3051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12998968#comment-12998968
 ] 

Jakob Korherr commented on MYFACES-3051:
----------------------------------------

>If we have a class that we are not expecting to override it or "consume" it in 
>some way, it does not have sense to put it in external context.

I disagree! What if we want to cache the instance per webapp?

>Thinking on MYFACES-3044, the best is suggest OSGi users to create a custom 
>ResourceHandler that can locate resources.

Really? The best? It is a really easy fix for us (note that the code is already 
committed - that's not the patch) and you want to tell all OSGi users to 
provide their custom ResourceHandler for MyFaces' internal resources like 
jsf.js. I'm sorry, but this is stupid. If we do not fix this, I will vote -1 on 
the next release. Sorry, but that kinda annoys me.

>From my point of view, we are adding more unnecessary complexity to something 
>that should be simple and clear.

I disagree. IMHO a custom ClassLoader is a lot easier to use than lots of 
static methods.

However that's my point of view against yours, so I'd like to propose a mixed 
solution for this problem:

1) use MyFacesClassLoader only inside static methods of ClassLoaderUtils and 
also in the two ResourceLoaders (fixes MYFACES-3044).
2) use static methods of ClassLoaderUtils in all other places of the code.

Does that sound acceptable to you?

> Use multiple ClassLoaders to find resources (not only ContextClassLoader)
> -------------------------------------------------------------------------
>
>                 Key: MYFACES-3051
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3051
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.0.4
>         Environment: OSGi
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-3051-first-draft.patch, 
> MYFACES-3051-impl-and-shared-2.patch, MYFACES-3051-impl-and-shared.patch
>
>
> In most parts of the code we only use the ContextClassLoader to find Classes 
> and Resources. However, in some parts we also use the ClassLoader of the 
> current Class or of a specific Class (e.g. to use myfaces-api and/or 
> myfaces-impl ClassLoader, see ApplicationImpl.getResourceBundle(), 
> BeanValidator.postSetValidationGroups(), ResourceHandlerImpl.getBundle() or 
> FactoryFinder for example).
> IMO we should unify this code and maybe provide a custom ClassLoader that 
> encapsulates three ClassLoaders (ContextClassLoader, myfaces-api and 
> myfaces-impl). This most certainly would solve a lot of OSGi related problems.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to