views:

378

answers:

1

What is the role of activator class in eclipse plugin ?

+5  A: 

The activator class handles the lifecycle of the plug-in and provides access to both the underlying OSGi system (i.e. the service registry etc.) and the content of the plug-in (e.g. image files that are contained in the plug-in).

A common use case of the activator is to register an OSGi service when the plug-in is started and to unregister the service when the plug-in is stopped.

ftl
Just in addition - an OSGi bundle (equal to plugin, which is an eclipse specific and historic name) does not require an activator class. If the bundle/plugin does not provide OSGi services, you can go without it - although it doesn't hurt to have one. Bundles that wrap java libraries typically don't have activators
Andreas_D