aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alasdair Nottingham (JIRA)" <j...@apache.org>
Subject [jira] Work started: (ARIES-41) In JNDI ServiceHelper we should also check for the current thread's context classloader's parent
Date Thu, 12 Nov 2009 11:32:39 GMT

     [ https://issues.apache.org/jira/browse/ARIES-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Work on ARIES-41 started by Alasdair Nottingham.

> In JNDI ServiceHelper we should also check for the current thread's context classloader's
parent
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-41
>                 URL: https://issues.apache.org/jira/browse/ARIES-41
>             Project: Aries
>          Issue Type: Bug
>          Components: JNDI
>            Reporter: Lin Sun
>            Assignee: Alasdair Nottingham
>            Priority: Minor
>
> Hi,
> In the ServiceHelper.getBundleContext(), if the current thread's context classloader
is not an instance of BundleReference, we should also try to check its parent to see if it
is an instance of BundleReference.   If it is, then grab the bundle context accordingly. 
What do people think?
> Proposed change: 
>     ClassLoader cl = Thread.currentThread().getContextClassLoader();
>     if (cl instanceof BundleReference) {
>       result = ((BundleReference)cl).getBundle().getBundleContext();
> +    } else if (cl.getParent() instanceof BundleReference) {
> +     result = ((BundleReference)cl.getParent()).getBundle().getBundleContext();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message