karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Pieber <anpie...@gmail.com>
Subject Re: Starting/Stopping Programmatically Bundles
Date Mon, 16 Jan 2012 17:13:55 GMT

I'm not quite sure what you want to achieve... If you simply want to
start/stop installed bundles the best way is to use the BundleContext (you
can get it e.g. via the Activator) and use the install method (and start
stop ond bundleContext.getBundle()).

If you want to listen for bundles started and stopped the BundleListener is
the way to go and you really should be notified. Can you share your code

Kind regards,

On Mon, Jan 16, 2012 at 18:07, Hervé BARRAULT <herve.barrault@gmail.com>wrote:

> HI, i'm using Karaf 2.0.0 and i'm trying to find a way to start/stop a
> bundle with java code.
> I have difficulties to find the right API to use (and which service to
> import).
> I have tried to create a BundleListener and expose it as an osgi
> service (in order to being notified of bundles start/stop) but i'm not
> notified.
> I thought getting data about bundles and being able to manipulate it.
> What are the correct steps to do this ?
> Regards
> Hervé

View raw message