felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrei Pozolotin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-2951) guidelines: felix osgi bundle class load vs Thread.currentThread().getContextClassLoader().getResource("")
Date Sat, 14 May 2011 15:44:47 GMT

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

Andrei Pozolotin commented on FELIX-2951:
-----------------------------------------

or may be felix has alternative to this:
http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements

> guidelines:   felix osgi bundle class load    vs    Thread.currentThread().getContextClassLoader().getResource("")
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-2951
>                 URL: https://issues.apache.org/jira/browse/FELIX-2951
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-3.2.1
>            Reporter: Andrei Pozolotin
>
> Richard, hello;
> 1) here you say
>       http://old.nabble.com/Can-the-thread-context-classloader-issue-be-solved-at-all--td28260809.html
> that "There is no reliable way to do this since..."
> 2) this project
>       http://pivot.apache.org/index.html
> is using this kind of pattern quite often:
> ImageView ::
>     /**
>      * Sets the image view's image by {@linkplain ClassLoader#getResource(String)
>      * resource name}.
>      *
>      * @param imageName
>      * The resource name of the image to set.
>      *
>      * @see #setImage(URL)
>      */
>     public final void setImage(String imageName) {
>         if (imageName == null) {
>             throw new IllegalArgumentException("imageName is null.");
>         }
>         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
>         setImage(classLoader.getResource(imageName.substring(1)));
>     }
> 3) instead of trying to work around this inside of felix, can you please provide
> a set of guidelines for developers of projects such as apache pivot,
> so the issue is gone?
> thank you;
> Andrei

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

Mime
View raw message