You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Andrei Pozolotin (JIRA)" <ji...@apache.org> on 2011/06/14 00:35:49 UTC

[jira] [Commented] (PIVOT-742) pluggable classloader

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

Andrei Pozolotin commented on PIVOT-742:
----------------------------------------

one more place that ignores both TCCL & and loader provided via  BXMLSerializer(final ClassLoader classLoader) :

public class BXMLSerializer implements Serializer<Object>, Resolvable {

    protected Serializer<?> newIncludeSerializer(Class<? extends Serializer<?>> type)
        throws InstantiationException, IllegalAccessException {
        return type.newInstance();
    }


    protected Object newTypedObject(Class<?> type)
        throws InstantiationException, IllegalAccessException {
        return type.newInstance();
    }


> pluggable classloader
> ---------------------
>
>                 Key: PIVOT-742
>                 URL: https://issues.apache.org/jira/browse/PIVOT-742
>             Project: Pivot
>          Issue Type: Improvement
>            Reporter: Andrei Pozolotin
>         Attachments: CLPlugin.java, CLPluginTCCL.java, CLProvider.java, UseCase.java
>
>
> pluggable classloader:
> 1) in current pivot trunk, TCCL, Thread.currentThread().getContextClassLoader().... is mentioned 105 times
> I suggest to centralize it and replace with pluggable classloader (which can use TCCL by default);
> 2) review all other uses of Class.getResource(), which are not using TCCL, and convert when possible;
> motivation:
> https://issues.apache.org/jira/browse/PIVOT-22
> https://issues.apache.org/jira/browse/FELIX-2951
> http://njbartlett.name/2010/08/30/osgi-readiness-loading-classes.html 
> http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements
> http://stackoverflow.com/questions/2198928/better-handling-of-thread-context-classloader-in-osgi
> http://mail-archives.apache.org/mod_mbox/pivot-user/201105.mbox/%3C4DCDF889.10506@gmail.com%3E

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

        

Re: [jira] [Commented] (PIVOT-742) pluggable classloader

Posted by Andrei Pozolotin <an...@gmail.com>.
Greg, hi;

re: https://issues.apache.org/jira/browse/PIVOT-742

do you think you could accept a patch for BXMLSerializer  that:

1) removes this constructor:

        new BXMLSerializer(loader)

2) replaces places like this:

                        if (classLoader == null) {
                            propertyClass =
Class.forName(propertyClassName);
                        } else {
                            propertyClass =
Class.forName(propertyClassName, true, classLoader);
                        }

with "normal" TCCL:

        ClassLoader classLoader =
Thread.currentThread().getContextClassLoader();
        propertyClass = Class.forName(propertyClassName, true, classLoader);

which is consistent with 100 and 5 other places pivot uses TCCL? :-)

thanks,

Andrei.

-------- Original Message  --------
Subject: [jira] [Commented] (PIVOT-742) pluggable classloader
From: Andrei Pozolotin (JIRA) <ji...@apache.org>
To: dev@pivot.apache.org
Date: Mon 13 Jun 2011 05:35:49 PM CDT
>     [ https://issues.apache.org/jira/browse/PIVOT-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048840#comment-13048840 ] 
>
> Andrei Pozolotin commented on PIVOT-742:
> ----------------------------------------
>
> one more place that ignores both TCCL & and loader provided via  BXMLSerializer(final ClassLoader classLoader) :
>
> public class BXMLSerializer implements Serializer<Object>, Resolvable {
>
>     protected Serializer<?> newIncludeSerializer(Class<? extends Serializer<?>> type)
>         throws InstantiationException, IllegalAccessException {
>         return type.newInstance();
>     }
>
>
>     protected Object newTypedObject(Class<?> type)
>         throws InstantiationException, IllegalAccessException {
>         return type.newInstance();
>     }
>
>
>   
>> pluggable classloader
>> ---------------------
>>
>>                 Key: PIVOT-742
>>                 URL: https://issues.apache.org/jira/browse/PIVOT-742
>>             Project: Pivot
>>          Issue Type: Improvement
>>            Reporter: Andrei Pozolotin
>>         Attachments: CLPlugin.java, CLPluginTCCL.java, CLProvider.java, UseCase.java
>>
>>
>> pluggable classloader:
>> 1) in current pivot trunk, TCCL, Thread.currentThread().getContextClassLoader().... is mentioned 105 times
>> I suggest to centralize it and replace with pluggable classloader (which can use TCCL by default);
>> 2) review all other uses of Class.getResource(), which are not using TCCL, and convert when possible;
>> motivation:
>> https://issues.apache.org/jira/browse/PIVOT-22
>> https://issues.apache.org/jira/browse/FELIX-2951
>> http://njbartlett.name/2010/08/30/osgi-readiness-loading-classes.html 
>> http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements
>> http://stackoverflow.com/questions/2198928/better-handling-of-thread-context-classloader-in-osgi
>> http://mail-archives.apache.org/mod_mbox/pivot-user/201105.mbox/%3C4DCDF889.10506@gmail.com%3E
>>     
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>         
>
>