Eclipse Plugin Settings - Activation and Singleton Settings
Asked Answered
A

1

14

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

Argentina answered 3/11, 2011 at 15:35 Comment(0)
F
13
  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.

Floruit answered 3/11, 2011 at 17:14 Comment(1)
Thank you Alexey, you helped me to understand more about plug-in activation.Argentina

© 2022 - 2024 — McMap. All rights reserved.