You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Andrei Petru Mura <ma...@gmail.com> on 2021/09/23 13:15:29 UTC

Listening for bundle event

I want to remotely manage my karaf instance, programatically. I think a
good option for this is the JMX service which karaf already provides. Is
there a way to simply add a listener for a bundle which I know follows to
be installed and then to wait for notifications on this bundle state
changes? Or any type of events related to it?

Thanks,
Andrei

Re: Listening for bundle event

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Ah, OK, you don't need the sync, just get the status.

In that case, maybe Cave Deployer API can help:

http://karaf.apache.org/manual/cave/latest-4/#_deployer

You can check features/bundles state on the Karaf instances farm.

Regards
JB

On 28/09/2021 10:15, Andrei Petru Mura wrote:
> I don't need to manage more instances of Karaf servers. I only need to 
> get the status programmatically. This behavior is used in an app that is 
> for testing purposes, as I already mentioned in a different thread. Do 
> you think it is a better approach to use cellar for such a small thing?
> 
> Form Cellar's documentation book I read:
> 
> The first goal of Karaf Cellar is to synchronize the status of several 
> Karaf instances (named nodes).
> 
> Cellar provides dedicated shell commands and JMX MBeans to manage the 
> cluster, and manipulate the resources on the cluster.
> 
> It doesn't seem to me that this would be necessary for my task to be 
> achieved. Do you have some other opinion?
> 
> Thanks,
> 
> Andrei
> 
> 
> On Thu, Sep 23, 2021 at 4:21 PM Jean-Baptiste Onofré <jb@nanthrax.net 
> <ma...@nanthrax.net>> wrote:
> 
>     Hi,
> 
>     Why not using Cellar for remote notification ?
> 
>     Else, a simple possibility is to implement a bundle listener and use
>     eventadmin to broadcast the events.
> 
>     Regards
>     JB
> 
>     On 23/09/2021 15:15, Andrei Petru Mura wrote:
>      > I want to remotely manage my karaf instance, programatically. I
>     think a
>      > good option for this is the JMX service which karaf already
>     provides. Is
>      > there a way to simply add a listener for a bundle which I know
>     follows
>      > to be installed and then to wait for notifications on this bundle
>     state
>      > changes? Or any type of events related to it?
>      >
>      > Thanks,
>      > Andrei
> 

Re: Listening for bundle event

Posted by Andrei Petru Mura <ma...@gmail.com>.
I don't need to manage more instances of Karaf servers. I only need to get
the status programmatically. This behavior is used in an app that is for
testing purposes, as I already mentioned in a different thread. Do you
think it is a better approach to use cellar for such a small thing?

Form Cellar's documentation book I read:

The first goal of Karaf Cellar is to synchronize the status of several
Karaf instances (named nodes).

Cellar provides dedicated shell commands and JMX MBeans to manage the
cluster, and manipulate the resources on the cluster.

It doesn't seem to me that this would be necessary for my task to be
achieved. Do you have some other opinion?

Thanks,

Andrei

On Thu, Sep 23, 2021 at 4:21 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> Hi,
>
> Why not using Cellar for remote notification ?
>
> Else, a simple possibility is to implement a bundle listener and use
> eventadmin to broadcast the events.
>
> Regards
> JB
>
> On 23/09/2021 15:15, Andrei Petru Mura wrote:
> > I want to remotely manage my karaf instance, programatically. I think a
> > good option for this is the JMX service which karaf already provides. Is
> > there a way to simply add a listener for a bundle which I know follows
> > to be installed and then to wait for notifications on this bundle state
> > changes? Or any type of events related to it?
> >
> > Thanks,
> > Andrei
>

Re: Listening for bundle event

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

Why not using Cellar for remote notification ?

Else, a simple possibility is to implement a bundle listener and use 
eventadmin to broadcast the events.

Regards
JB

On 23/09/2021 15:15, Andrei Petru Mura wrote:
> I want to remotely manage my karaf instance, programatically. I think a 
> good option for this is the JMX service which karaf already provides. Is 
> there a way to simply add a listener for a bundle which I know follows 
> to be installed and then to wait for notifications on this bundle state 
> changes? Or any type of events related to it?
> 
> Thanks,
> Andrei