You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2011/12/21 17:59:50 UTC

Idea: Dynamic information in feature:info or bundles:info

Hi all,

I just had an idea how we could improve the features:info and 
bundles:info commands.

Currently we only write static informations. How about having a service 
interface a bundle can register to offer some informations about its 
inner workings.
A feature could then name the bundle that returns this information.

So for example for the http feature this service could return the port 
number and the list of servlets it manages with their informations.

Like that:
=====================================================
features:info http
Description of http 2.2.4 feature
----------------------------------------------------------------
Feature configuration:
   org.ops4j.pax.web
Feature configuration files:
   /etc/jetty.xml
Feature depends on:
   jetty [7.0,8.0)
Feature contains followed bundles:
   mvn:org.ops4j.pax.web/pax-web-api/1.0.7
   mvn:org.ops4j.pax.web/pax-web-spi/1.0.7
   mvn:org.ops4j.pax.web/pax-web-runtime/1.0.7
   mvn:org.ops4j.pax.web/pax-web-jetty/1.0.7
-----------------------------------------------------------------
Port: 8181
Managed Servlets:
| alias                      | bundle id |
| /system/console |             12 |
=====================================================

User bundles could provide their custom informations too.

The service interface could look like this:

public interface BundleInformationService {
   String getInfoString();
}

We could then also provide this information in the bundle and feature 
mbeans.

Christian

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Idea: Dynamic information in feature:info or bundles:info

Posted by Christian Schneider <ch...@die-schneider.net>.
Yes I also saw the similarities with JMX. Perhaps we can even reuse the 
JMX classes and let the service be mbean compatible too. Another thing 
is that an interface provided by us makes people dependent on karaf.
So we could simply support any interface and trigger by service properties.

Christian


Am 21.12.2011 21:06, schrieb Jean-Baptiste Onofré:
> Hi Christian,
>
> The idea is interesting.
>
> I implemented the OSGI-INF/bundle.info support, but I'm afraid is not 
> heavily users/useful, so any way to provide more useful information is 
> valuable.
>
> Even if I think that using an OSGi service for information could 
> "perturb" some users, I like the idea. However, I think that the 
> interface should be richer, providing generic ValueObject or so 
> (something similar to JMX CompositeData/TabularData).
>
> Regards
> JB
>
> On 12/21/2011 05:59 PM, Christian Schneider wrote:
>> Hi all,
>>
>> I just had an idea how we could improve the features:info and
>> bundles:info commands.
>>
>> Currently we only write static informations. How about having a service
>> interface a bundle can register to offer some informations about its
>> inner workings.
>> A feature could then name the bundle that returns this information.
>>
>> So for example for the http feature this service could return the port
>> number and the list of servlets it manages with their informations.
>>
>> Like that:
>> =====================================================
>> features:info http
>> Description of http 2.2.4 feature
>> ----------------------------------------------------------------
>> Feature configuration:
>> org.ops4j.pax.web
>> Feature configuration files:
>> /etc/jetty.xml
>> Feature depends on:
>> jetty [7.0,8.0)
>> Feature contains followed bundles:
>> mvn:org.ops4j.pax.web/pax-web-api/1.0.7
>> mvn:org.ops4j.pax.web/pax-web-spi/1.0.7
>> mvn:org.ops4j.pax.web/pax-web-runtime/1.0.7
>> mvn:org.ops4j.pax.web/pax-web-jetty/1.0.7
>> -----------------------------------------------------------------
>> Port: 8181
>> Managed Servlets:
>> | alias | bundle id |
>> | /system/console | 12 |
>> =====================================================
>>
>> User bundles could provide their custom informations too.
>>
>> The service interface could look like this:
>>
>> public interface BundleInformationService {
>> String getInfoString();
>> }
>>
>> We could then also provide this information in the bundle and feature
>> mbeans.
>>
>> Christian
>>
>


-- 

Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Idea: Dynamic information in feature:info or bundles:info

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

The idea is interesting.

I implemented the OSGI-INF/bundle.info support, but I'm afraid is not 
heavily users/useful, so any way to provide more useful information is 
valuable.

Even if I think that using an OSGi service for information could 
"perturb" some users, I like the idea. However, I think that the 
interface should be richer, providing generic ValueObject or so 
(something similar to JMX CompositeData/TabularData).

Regards
JB

On 12/21/2011 05:59 PM, Christian Schneider wrote:
> Hi all,
>
> I just had an idea how we could improve the features:info and
> bundles:info commands.
>
> Currently we only write static informations. How about having a service
> interface a bundle can register to offer some informations about its
> inner workings.
> A feature could then name the bundle that returns this information.
>
> So for example for the http feature this service could return the port
> number and the list of servlets it manages with their informations.
>
> Like that:
> =====================================================
> features:info http
> Description of http 2.2.4 feature
> ----------------------------------------------------------------
> Feature configuration:
> org.ops4j.pax.web
> Feature configuration files:
> /etc/jetty.xml
> Feature depends on:
> jetty [7.0,8.0)
> Feature contains followed bundles:
> mvn:org.ops4j.pax.web/pax-web-api/1.0.7
> mvn:org.ops4j.pax.web/pax-web-spi/1.0.7
> mvn:org.ops4j.pax.web/pax-web-runtime/1.0.7
> mvn:org.ops4j.pax.web/pax-web-jetty/1.0.7
> -----------------------------------------------------------------
> Port: 8181
> Managed Servlets:
> | alias | bundle id |
> | /system/console | 12 |
> =====================================================
>
> User bundles could provide their custom informations too.
>
> The service interface could look like this:
>
> public interface BundleInformationService {
> String getInfoString();
> }
>
> We could then also provide this information in the bundle and feature
> mbeans.
>
> Christian
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com