Home » Eclipse Projects » Eclipse Platform » Invoke/Load/Launch a particular version of the plugin programatically/dynamicall
Invoke/Load/Launch a particular version of the plugin programatically/dynamicall [message #335334] |
Wed, 01 April 2009 15:45  |
Eclipse User |
|
|
|
Hi,
I have a usecase where I need to load / launch /invoke a particular
version of my plugin depending on some criteria at runtime programatically
/ dynamically. My eclipse package will contain multiple versions of the
same plugin, and I need to invoke a particular version depending on some
criteria programatically. Is there a way to do this? could some one please
throw some light into this.
Thanks much in advance,
Nitha
|
|
| | | | |
Re: Invoke/Load/Launch a particular version of the plugin programatically/dynamicall [message #335442 is a reply to message #335427] |
Wed, 08 April 2009 10:00   |
Eclipse User |
|
|
|
Nitha wrote:
> Hi Paul,
>
> Thanks for your quick reply.
> It doesn't look like enabling/disabling would work out for my problem....
You mean dynamically installing/starting the plugins won't work? You
have complete control over whether your app can see your plugins, that's
as good as it gets. Or do you mean it's not clear how to do this?
As for using different config areas: You would need different
configuration directories and different p2 profiles. Adding the plugins
to the different p2 profiles can be done using the p2 Directory app
(editing the bundles.info directly is not recommended, as that's only
part of what p2 needs). See
http://wiki.eclipse.org/Equinox_p2_director_application As I understand
it, you would need 3 different profiles (for each set of plugins) and 3
different configuration areas.
Maybe you need to describe your original usecase again. You need to
launch "different versions" of your plugin. What makes the versions
different (do they contain different versions of a lib, do they contain
any extensions, etc)? What is the criteria for picking a different
version (user preference, license, functionality, other software that's
installed, etc)?
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
|
|
|
Re: Invoke/Load/Launch a particular version of the plugin programatically/dynamicall [message #335447 is a reply to message #335442] |
Wed, 08 April 2009 15:32   |
Eclipse User |
|
|
|
Paul Webster wrote:
> Nitha wrote:
>> Hi Paul,
>>
>> Thanks for your quick reply.
>> It doesn't look like enabling/disabling would work out for my problem....
> You mean dynamically installing/starting the plugins won't work? You
> have complete control over whether your app can see your plugins, that's
> as good as it gets. Or do you mean it's not clear how to do this?
I am guessing that programatically installing/starting a version and
stopping all other verions of the plugins might effect the perfomance as
there could be many plugins that need this install->start and
stop->uninstall. Say our product has about 50 plugins(with extensions and
extension points), and if we were to support 3 versions of each plugin for
a release, and depending on the version of our product customer has we
want to enable that version set of plugins. Also, I did not find a way to
get hold of Inactive plugins, i.e. if I have version 1, 2, 3 of "plugin A"
deployed in plugins folder, is there an API to get hold of all the 3
versions of this plugin. BundleContext or Bundle API gives only the latest
installed version altough it returns an array, it contains only one
plugin, the ACTIVE plugin i.e the latest version. (By the way this is for
our Headless product) Please Let me know if the problem usecase is still
not clear.
> As for using different config areas: You would need different
> configuration directories and different p2 profiles. Adding the plugins
> to the different p2 profiles can be done using the p2 Directory app
> (editing the bundles.info directly is not recommended, as that's only
> part of what p2 needs). See
> http://wiki.eclipse.org/Equinox_p2_director_application As I understand
> it, you would need 3 different profiles (for each set of plugins) and 3
> different configuration areas.
I am not very familiar with P2, Started looking into it this week. Yes, I
am thinking of different configuration directories (not sure what p2
profies are will read up on that...) I am thinking along the lines of each
bundle.info will define a particular version of plugins to load. I do have
concerns:
1) about whether bundles.info is modified/overwritten by eclipse starup
and in which cases does it do so.
2) If I need to replicate configuration folder for each version, do I need
all the content under default configuration folder or could I just have
subset of these for configuration1, configuration2, congiuration3
folders....
> Maybe you need to describe your original usecase again. You need to
In the first paragraph I restated the usecase, I hope it is better put
now, but please let me know if I am not clear...
> launch "different versions" of your plugin. What makes the versions
> different (do they contain different versions of a lib, do they contain
Different versions of the plugins may have libraries, bug fixes, new
features, new extensions etc...
> any extensions, etc)? What is the criteria for picking a different
> version (user preference, license, functionality, other software that's
> installed, etc)?
The criteria is the version of our product customer has. He could be on
older version of our product but need to install a pacakage(generated by
our product) created by newer version of our product or vice versa.
> PW
|
|
|
Re: Invoke/Load/Launch a particular version of the plugin programatically/dynamicall [message #335464 is a reply to message #335447] |
Thu, 09 April 2009 09:41   |
Eclipse User |
|
|
|
Nitha wrote:
> I am guessing that programatically installing/starting a version and
> stopping all other verions of the plugins might effect the perfomance as
> there could be many plugins that need this install->start and
> stop->uninstall. Say our product has about 50 plugins(with extensions
> and extension points), and if we were to support 3 versions of each
> plugin for a release, and depending on the version of our product
> customer has we want to enable that version set of plugins. Also, I did
> not find a way to get hold of Inactive plugins, i.e. if I have version
> 1, 2, 3 of "plugin A" deployed in plugins folder, is there an API to get
> hold of all the 3 versions of this plugin. BundleContext or Bundle API
> gives only the latest installed version altough it returns an array, it
> contains only one plugin, the ACTIVE plugin i.e the latest version. (By
> the way this is for our Headless product) Please Let me know if the
> problem usecase is still not clear.
Thank you for the explanation, that helps.
If you have extensions (if your bundles are singletons) then you will
only ever see the highest installed version ... that is the nature of
singletons. Library bundles (bundles that are not singletons) can have
multiple versions installed, resolved, and active at the same time. The
PackageAdmin service can be used to get references to the multiple
versions using
org.osgi.service.packageadmin.PackageAdmin.getBundles(String , String)
If it is really about running one of 3 different versions of your
product, then using multiple configuration areas (as they really are 3
different versions of your application) might be the best bet. But
changing between them will require a restart.
The performance of dynamically swapping plugins is not particularly bad,
as it's not something that happens a lot (it's a configuration step).
It's useful for selecting between say, 3 versions of 5 core plugins ...
but not for swapping most of your application plugins.
Let us know how it goes.
PW
--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
|
|
| | |
Goto Forum:
Current Time: Fri May 09 18:51:06 EDT 2025
Powered by FUDForum. Page generated in 0.05835 seconds
|