views:

46

answers:

2

I have deployed some Eclipse plugins and I want them to take effect without restarting the Eclipse environment. Is it posssible?

+1  A: 

Yes, it is. OSGi (and Eclipse is OSGi based) provides a way for dynamic bundle loading without the need to restart the environment. However, eclipse suggest a restart because it works in 100% of the cases, while it cannot guarantee that all plugins will be properly written. You have probably seen the "Apply changes" button after installing a plugin - this tries to reload it without restart.

Bozho
+2  A: 

At a pure OSGi level, you would use BundleContext.installBundle()and then PackageAdmin.refreshPackages(), and if necessary, perhaps Bundle.start().

How well this works in your running system will depend on how your bundle is being used by the rest of the system, and how things will react when an old version goes away and a new one appears.

Take a look at these 2 faq entries from the wiki:
How do I make my plug-in dynamic aware?
How do I make my plug-in dynamic enabled?

To do this at a higher level, you would take a look at p2.

Andrew Niefer