You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Lukasz Lech <l....@ringler.ch> on 2018/09/12 08:08:48 UTC

BundleState: Fragment

I'm checking health status of my Karaf container using BundleService.

I expect all bundles to be Active, however, 2 of them are Resolved.

Web Console shows their status as Fragment, however, org.apache.karaf.bundle.core.BundleStatus doesn't contain such state, and probably this is why it is casted to Resolved.

How can I find out that bundle is a Fragment and will never be Active?

Best regards,
Lukasz Lech


Re: BundleState: Fragment

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Correct.

Regards
JB

On 12/09/2018 10:50, Lukasz Lech wrote:
> OK so to find out if the bundle is fragment, I should check if it has "Fragment-Host" header?
> 
> I've made quick test and it seems to be the solution.
> 
> Best regards,
> Lukasz Lech
> 
> 
> -----Original Message-----
> From: Łukasz Dywicki [mailto:luke@code-house.org]
> Sent: Mittwoch, 12. September 2018 10:34
> To: user@karaf.apache.org; Lukasz Lech <l....@ringler.ch>
> Subject: Re: BundleState: Fragment
> 
> Dear Lukasz
> Fragment bundles are never active because they are attached to fragment host (pointed via manifest header).
> 
> There is no "fragment" state for bundle because it is type of bundle itself. You might have normal bundles and fragments attached to them.
> Highest state fragment bundle can have is resolved - meaning that it is attached to its host.
> 
> See wider description in specs:
> https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.fragmentbundles
> 
> Kind regards,
> Lukasz
> 
> 
> On 9/12/18 10:08 AM, Lukasz Lech wrote:
>> I'm checking health status of my Karaf container using BundleService.
>>
>>   
>>
>> I expect all bundles to be Active, however, 2 of them are Resolved.
>>
>>   
>>
>> Web Console shows their status as Fragment, however,
>> org.apache.karaf.bundle.core.BundleStatus doesn't contain such state,
>> and probably this is why it is casted to Resolved.
>>
>>   
>>
>> How can I find out that bundle is a Fragment and will never be Active?
>>
>>   
>>
>> Best regards,
>>
>> Lukasz Lech
>>
>>   
>>

RE: BundleState: Fragment

Posted by Lukasz Lech <l....@ringler.ch>.
OK so to find out if the bundle is fragment, I should check if it has "Fragment-Host" header? 

I've made quick test and it seems to be the solution. 

Best regards,
Lukasz Lech


-----Original Message-----
From: Łukasz Dywicki [mailto:luke@code-house.org] 
Sent: Mittwoch, 12. September 2018 10:34
To: user@karaf.apache.org; Lukasz Lech <l....@ringler.ch>
Subject: Re: BundleState: Fragment

Dear Lukasz
Fragment bundles are never active because they are attached to fragment host (pointed via manifest header).

There is no "fragment" state for bundle because it is type of bundle itself. You might have normal bundles and fragments attached to them.
Highest state fragment bundle can have is resolved - meaning that it is attached to its host.

See wider description in specs:
https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.fragmentbundles

Kind regards,
Lukasz


On 9/12/18 10:08 AM, Lukasz Lech wrote:
> I'm checking health status of my Karaf container using BundleService.
> 
>  
> 
> I expect all bundles to be Active, however, 2 of them are Resolved.
> 
>  
> 
> Web Console shows their status as Fragment, however, 
> org.apache.karaf.bundle.core.BundleStatus doesn't contain such state, 
> and probably this is why it is casted to Resolved.
> 
>  
> 
> How can I find out that bundle is a Fragment and will never be Active?
> 
>  
> 
> Best regards,
> 
> Lukasz Lech
> 
>  
> 

Re: BundleState: Fragment

Posted by Łukasz Dywicki <lu...@code-house.org>.
Dear Lukasz
Fragment bundles are never active because they are attached to fragment
host (pointed via manifest header).

There is no "fragment" state for bundle because it is type of bundle
itself. You might have normal bundles and fragments attached to them.
Highest state fragment bundle can have is resolved - meaning that it is
attached to its host.

See wider description in specs:
https://osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module.fragmentbundles

Kind regards,
Lukasz


On 9/12/18 10:08 AM, Lukasz Lech wrote:
> I’m checking health status of my Karaf container using BundleService.
> 
>  
> 
> I expect all bundles to be Active, however, 2 of them are Resolved.
> 
>  
> 
> Web Console shows their status as Fragment, however,
> org.apache.karaf.bundle.core.BundleStatus doesn’t contain such state,
> and probably this is why it is casted to Resolved.
> 
>  
> 
> How can I find out that bundle is a Fragment and will never be Active?
> 
>  
> 
> Best regards,
> 
> Lukasz Lech
> 
>  
>