Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » How to find out when a plan is successfully started?
How to find out when a plan is successfully started? [message #1747313] Fri, 11 November 2016 23:49 Go to next message
Raghuram Devarakonda is currently offline Raghuram DevarakondaFriend
Messages: 19
Registered: November 2012
Junior Member
Hi,

Is there any way to programmatically tell when a plan is started? I am wondering if there is any event generated by Virgo when this happens. We need something like this as we need to perform few initialization actions that require all the bundles in the plan are loaded.

If there is no such event, is there any other mechanism that can be used to find out when a plan is started?

We are using Virgo 3.6.2. Any help is greatly appreciated.

Thanks,
Raghu
Re: How to find out when a plan is successfully started? [message #1747325 is a reply to message #1747313] Sat, 12 November 2016 07:21 Go to previous messageGo to next message
GianMaria Romanato is currently offline GianMaria RomanatoFriend
Messages: 49
Registered: November 2015
Member
Bundles in a plan are started in the same order as they are listed.

You can therefore add an extra bundle at the end of the plan and do whatever you want in its activator.

Virgo also fires an event. If I remember correctly Glyn explained some time ago in a post that you can get a virgo service from the osgi registry and register a listener to be notified. I can't find the post now as I am on my mobile....
Re: How to find out when a plan is successfully started? [message #1747344 is a reply to message #1747325] Sat, 12 November 2016 21:36 Go to previous messageGo to next message
Raghuram Devarakonda is currently offline Raghuram DevarakondaFriend
Messages: 19
Registered: November 2012
Junior Member
Thanks for the response.

Perhaps, you are referring to this thread?
https://www.eclipse.org/forums/index.php/t/458168/
Re: How to find out when a plan is successfully started? [message #1747430 is a reply to message #1747344] Mon, 14 November 2016 15:44 Go to previous message
Raghuram Devarakonda is currently offline Raghuram DevarakondaFriend
Messages: 19
Registered: November 2012
Junior Member
Following the advice from a previous thread (referred to above), I have implemented the call back (by extending "org.eclipse.virgo.kernel.install.artifact.InstallArtifactLifecycleListenerSupport") and exported it as OSGi service. This did the trick and I can now tap into the life cycle of Plans as well as other artifacts.

However, while compiling my code, I found that Maven central doesn't have the necessary Virgo dependencies for the classes "InstallArtifactLifecycleListenerSupport" and "DeploymentException". They are part of the JARs "org.eclipse.virgo.kernel.deployer_3.6.2.RELEASE.jar" and "org.eclipse.virgo.nano.deployer.api_3.6.2.RELEASE.jar". I had to add them to my Maven repo explicitly in order to make the build succeed.

It would be very helpful if these and perhaps other Virgo artifacts are uploaded to Maven central.

Thanks,
Raghu
Previous Topic:Eclipse Virgo vs Pax-web
Next Topic:error when installing Snaps 3.0.2 on VTS 3.0.2
Goto Forum:
  


Current Time: Tue Sep 18 15:42:42 GMT 2018

Powered by FUDForum. Page generated in 0.02243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top