Skip to main content



      Home
Home » Eclipse Projects » Gemini » Auto PDE reload of 'Web' OSGi bundles?
Auto PDE reload of 'Web' OSGi bundles? [message #634935] Mon, 25 October 2010 03:50 Go to next message
Eclipse UserFriend
Hi folks,
I have been using Spring DM 2 for awhile now (looking to upgrade to Gemini), and I have a core 'Web' bundle in my project (and fragments that attach to it) that gets deployed into an embedded Jetty server. This works great except anytime I edit a resource I have to start and stop the application for the change to be picked up. Is there a solution for this? In WTP you can deploy an exploded WAR 'in place' and have changes picked up immediately. Is there a story on how to do the equivalent with OSGi+PDE+Gemini+Equinox?

I also cross-posted in the PDE forum but I'm not sure who's jurisdiction this really falls under Smile

http://www.eclipse.org/forums/index.php?t=msg&goto=63492 8&S=0be57ee19df7ebd6ce6adbeaef805ac9#msg_634928

Thanks-
David

[Updated on: Mon, 25 October 2010 03:51] by Moderator

Re: Auto PDE reload of 'Web' OSGi bundles? [message #634948 is a reply to message #634935] Mon, 25 October 2010 04:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

You can use the OSGi console to make your life easier. When you launch the OSGi framework within your IDE and see the "osgi>" prompt in the console view, then call the "ss" command. Use the output to see the bundle-id of you web application bundle.

Every time you need to refresh your web application without restart the OSGi framework, simply go in the OSGi console and type "refresh <bundle-id>", where you need to replace <bundle-id> with the actual bundle id of you web bundle.

There is a new project proposed to address such needs for web development using PDE. This is the OSGi Enterprise Tools: http://eclipse.org/proposals/osgi-enterprise-tools/

One of the features proposed, the Generic OSGi server adapter, is exactly about your use case.

Greetings,
Kaloyan
Re: Auto PDE reload of 'Web' OSGi bundles? [message #635117 is a reply to message #634948] Mon, 25 October 2010 12:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Kaloyan,
Nice tip, I hadn't seen the refresh command. Is this an Equinox command or in the OSGi spec? I hadn't seen it on the Bundle or BundleContext class previously.

I also didn't realize that Eclipse is rebuilding the jar everytime you save a resource, could I build a simple bundle that polls the modified time of the installed bundles and reloads them automatically from inside equinox? Obviously this isn't ideal, but would be a simple stop-gap between now and there being a trigger coming from Eclipse -> Equinox indicating a bundle needs to be refreshed.

Also I saw you were looking at November for an initial contribution of code.. I'd be happy to help test at least this feature in particular if desired.

Thanks,
David
Re: Auto PDE reload of 'Web' OSGi bundles? [message #635159 is a reply to message #635117] Mon, 25 October 2010 15:27 Go to previous message
Eclipse UserFriend
David Erickson wrote on Mon, 25 October 2010 19:32

Nice tip, I hadn't seen the refresh command. Is this an Equinox command or in the OSGi spec? I hadn't seen it on the Bundle or BundleContext class previously.


This is an OSGi command. If you look for an API, you should look at the PackageAdmin service (method refreshPackages):
http://www.osgi.org/javadoc/r4v42/org/osgi/service/packagead min/PackageAdmin.html

David Erickson wrote on Mon, 25 October 2010 19:32

I also didn't realize that Eclipse is rebuilding the jar everytime you save a resource, could I build a simple bundle that polls the modified time of the installed bundles and reloads them automatically from inside equinox? Obviously this isn't ideal, but would be a simple stop-gap between now and there being a trigger coming from Eclipse -> Equinox indicating a bundle needs to be refreshed.


Well... Tracking changes in the workspace project is a problem already solved by the WTP Server API. There is no need to think about this when implementing the Generic OSGi Server Adapter.

David Erickson wrote on Mon, 25 October 2010 19:32

Also I saw you were looking at November for an initial contribution of code.. I'd be happy to help test at least this feature in particular if desired.


There are ongoing discussions with other parties that want to contribute. I believe these discussions will settle done in a month and the project will be created. Then the contribution will be possible.

[Updated on: Mon, 25 October 2010 15:27] by Moderator

Previous Topic:Gemini Web Release and Graduation Review Successful
Next Topic:Gemini Web 1.1.0.RELEASE
Goto Forum:
  


Current Time: Sat Jul 26 02:50:14 EDT 2025

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

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

Back to the top