Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:50 Go to next message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
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 07:51]

Report message to a moderator

Re: Auto PDE reload of 'Web' OSGi bundles? [message #634948 is a reply to message #634935] Mon, 25 October 2010 08:17 Go to previous messageGo to next message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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 16:32 Go to previous messageGo to next message
David Erickson is currently offline David EricksonFriend
Messages: 21
Registered: April 2010
Junior Member
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 19:27 Go to previous message
Kaloyan Raev is currently offline Kaloyan RaevFriend
Messages: 201
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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 19:27]

Report message to a moderator

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


Current Time: Thu Apr 25 01:17:24 GMT 2024

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

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

Back to the top