Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Plugin Settings - Activation and Singleton Settings

In the Eclipse manifest editor, there exist check boxes for enabling/disabling plug-in activation and singleton behavior, as shown below:

[ ] Activate this plug-in when one of its classes is loaded
[ ] This plug-in is a singleton

Questions:

  1. When would the activation check box NOT be checked?
  2. If wrapping a third-party library, should this plug-in "usually" be configured as a singleton?

I'm searching for information or some examples that would demonstrate when activation of the plugin would not be desired (i.e., intentional non-activation). The singleton behavior is clearer (in my opinion) to see when it would be appropriate (e.g., a logger).

Much thanks!
Michael

like image 825
Michael Avatar asked Nov 03 '11 15:11

Michael


People also ask

What is Singleton plugin?

singleton - Indicates that the bundle can only have a single version resolved in an environment. A value of true indicates that the bundle is a singleton bundle.

What is plugin in eclipse?

Plugin , which is an abstract class that provides generic facilities for managing plug-ins. An Eclipse installation includes a plugins folder where individual plug-ins are deployed. Each plug-in is installed in its own folder under the plugins folder. A plug-in is described in an XML manifest file, called plugin.


1 Answers

  1. When you both don't a) need to do anything special when the plug-in starts and stops; b) don't have any extensions in plugin.xml which are only picked up on activation. However, those are circumstances where you can not activate. Since it's easy enough to forget about turning automatic activation on when they change, I'd still check the option even in this case. I don't know of any situation where you'd actively want to turn automatic activation off.

  2. No, usually not. Only when two instances of this plug-in would interfere with each other. As you suggest, a logger (both would try to write to same files), a printing library, a graphics toolkit, etc.

like image 152
Alexey Romanov Avatar answered Sep 27 '22 19:09

Alexey Romanov