BundleState: Fragment

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

BundleState: Fragment

lechlukasz

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

 

Reply | Threaded
Open this post in threaded view
|

Re: BundleState: Fragment

luke
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
>
>  
>
Reply | Threaded
Open this post in threaded view
|

RE: BundleState: Fragment

lechlukasz
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:[hidden email]]
Sent: Mittwoch, 12. September 2018 10:34
To: [hidden email]; Lukasz Lech <[hidden email]>
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
>
>  
>
Reply | Threaded
Open this post in threaded view
|

Re: BundleState: Fragment

jbonofre
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:[hidden email]]
> Sent: Mittwoch, 12. September 2018 10:34
> To: [hidden email]; Lukasz Lech <[hidden email]>
> 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
>>
>>  
>>