Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regarding 'singleton:=true' in Manifest file

I have a plugin which at present doesn't have any extension points (neither does it extend any other plugin). To resolve a certain issue I have to create an extension-point for this plugin and an appropriate extension somewhere else.

When doing this eclipse forced me to set singleton:=true in the Manifest file. I know the reason why this parameter has to be set, but I wanted to know if there are any implications on the functioning of the plugin within the product by introducing this parameter.

Thank you.

like image 790
Sagar V Avatar asked Oct 22 '10 05:10

Sagar V


2 Answers

"singleton:=true" means that bundle only have one version could exist in the OSGi runtime.

Eclipse automatically adds the flag due to you provide an extension point in your bundle. If there are two version of your bundles providing the same extension point(have the same identity, might different attributes or elements) would make things mess.

like image 60
Kane Avatar answered Sep 29 '22 05:09

Kane


From the Book Eclipse plugin Development by Dr Alex Blewitt:

The clause

singleton:=true 

is an OSGi directive, which means that only one version of this plug-in can be installed in Eclipse at one time.

For plug-ins which add dependencies to the UI, there is a restriction that they must be singletons. (This constraint is one of the main reasons why installing a new plug-requires the IDE to restart.)

like image 37
Anand Avatar answered Sep 29 '22 06:09

Anand