Thanks Stuart, that surely helps.

The spawned question is why Pax-Construct doesn't use R4.1 by default... I
continue this discussion in the other thread (regarding "osgi_core")

On Fri, Jun 27, 2008 at 1:13 PM, Stuart McCulloch <
[EMAIL PROTECTED]> wrote:

> 2008/6/27 Stuart McCulloch <[EMAIL PROTECTED]>:
>
>> 2008/6/27 Hendy Irawan <[EMAIL PROTECTED]>:
>>
>>> In Extender pattern, if we register services it should be registered
>>> - under the bundle that is being loaded,
>>>  instead of
>>> - under the bundle that holds the extender,
>>> is this correct?
>>>
>>
>> yes, typically the extender will register on behalf of the other bundle,
>> using its context
>>
>
> just to clarify, by "its" I mean the bundle being loaded ;)
>
>  I've just implemented a project here:
>>> https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/pax-script
>>> using Pax Swissbox Extender.
>>>
>>> Problem is:
>>>
>>>                 new BundleObserver<URL>() {
>>>
>>>                     @Override
>>>                     public void addingEntries(Bundle bundle, List<URL>
>>> urls) {
>>>                         log.info(String.format("Bundle %s added with %d
>>> factories.", bundle.getSymbolicName(), urls.size()));
>>> ...
>>>
>>> I only get the Bundle instance, not the BundleContext for that bundle.
>>>
>>> So I can only register services using the extender's BundleContext, not
>>> the "extended's" BundleContext (I hope the wording is clear).
>>>
>>> To sum it up, is there a way, to do either of below:
>>> - get the BundleContext of the observed bundle, in Pax Swissbox API?
>>> - get the BundleContext, given a Bundle (pure OSGi API)?
>>>
>>
>> this was added as part of the R4.1 update to the specification (API
>> version 1.4)
>>
>>
>> http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html#getBundleContext()<http://www2.osgi.org/javadoc/r4/org/osgi/framework/Bundle.html#getBundleContext%28%29>
>>
>> and afaik is now supported in all the R4 frameworks - previously extender
>> services
>> like declarative services used a non-standard framework call which tied
>> each DS
>> implementation to its framework, now extenders should use this method
>> instead.
>>
>> the R4.1 API can be found here:
>>
>>   http://repository.ops4j.org/maven2/org/osgi/org.osgi.core/4.1.0
>>
>> HTH
>>
>>  --
>>> Best regards,
>>> Hendy Irawan
>>> _______________________________________________
>>> general mailing list
>>> general@lists.ops4j.org
>>> http://lists.ops4j.org/mailman/listinfo/general
>>>
>>>
>>
>>
>> --
>> Cheers, Stuart
>
>
>
>
> --
> Cheers, Stuart
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>


-- 
Best regards,
Hendy Irawan
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to