You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Jeremy Hughes (JIRA)" <ji...@apache.org> on 2010/02/24 17:44:35 UTC

[jira] Updated: (ARIES-41) In JNDI ServiceHelper we should also check for the current thread's context classloader's parent

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

Jeremy Hughes updated ARIES-41:
-------------------------------

    Fix Version/s: 0.1

> 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
>             Fix For: 0.1
>
>
> 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.