Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Equinox Declarative Services : Context Class Loader

The question is, what did you expect instead of null?

The OSGi spec does not specify what the thread context classloader
(TCCL) should be when services or callbacks are invoked, therefore
components should not rely on it being set to anything in particular.
You can of course set the TCCL explicitly at the start of your
activate method.

The reason for this, incidentally, is that TCCLs are intended to
support the concept of a global "application", and they are not really
a good fit with the classloading model in OSGi. However as you have
probably discovered, many legacy libraries have expectations about the
TCCL and we must work around those expectations. You may wish to look
at the Spring-DM component framework as an alternative to DS, as it
does include some support for declaratively setting the TCCL in
service methods (I'm not sure if it also works in the "init" and
"destroy" methods though).

Regards,
Neil

2009/3/31 Sameera Jayasoma <sameera.madushan@xxxxxxxxx>:
> Hi all
>
> I am using Equinox Declarative Services implementation. When my component
> gets activated, the “activate” method is invoked on the component
> implementation class and that is expected behavior. But the context class
> loader of the thread which invoke the “activate” method is null. I am having
> problems because of this. Is this the expected behavior in the DS
> implementation? Any help would be greatly appreciated.
>
> Thanks
>
> --
> Sameera Jayasoma
>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>
>


Back to the top