You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Romain Gilles <ro...@gmail.com> on 2013/04/26 11:40:37 UTC

How to listen if a feature is started

Hi all,
I would like to know if there is a way to listen feature installation /
start completion?

Thanks,

Romain

Re: How to listen if a feature is started

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

create a class which implements org.apache.karaf.features.FeaturesListener.

You have to implement:

public void featureEvent(FeatureEvent event);

In this method, with the event, you can:
- get the feature (event.getFeature())
- get the event type (FeatureEvent.EventType.FeaturesInstalled for instance)
- do what you want ;)

Your class has just to be register as a service, for instance in Blueprint:

<bean id="myFeaturesListener" class="..."/>
<service ref="myFeaturesListener" 
interface="org.apache.karaf.features.FeaturesListener"/>

Regards
JB

On 04/26/2013 11:43 AM, Achim Nierbeck wrote:
> Hi,
>
> retrieve the features service and look for the installed feature. That
> should do.
>
> regards, Achim
>
>
> 2013/4/26 Romain Gilles <romain.gilles@gmail.com
> <ma...@gmail.com>>
>
>     Hi all,
>     I would like to know if there is a way to listen feature
>     installation / start completion?
>
>     Thanks,
>
>     Romain
>
>
>
>
> --
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
> & Project Lead
> OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
> Commiter & Project Lead
> blog <http://notizblog.nierbeck.de/>

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

Re: How to listen if a feature is started

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

retrieve the features service and look for the installed feature. That
should do.

regards, Achim


2013/4/26 Romain Gilles <ro...@gmail.com>

> Hi all,
> I would like to know if there is a way to listen feature installation /
> start completion?
>
> Thanks,
>
> Romain
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home>
Commiter & Project Lead
blog <http://notizblog.nierbeck.de/>