Activator is a class in a Eclipse plugin which controls the plug-in life cycle. It contains methods like
stop(BundleContext context) and a static method
Activator getDefault() – which returns static field
plugin. What is interesting the the static field
plugin is set in the non-static public method
start(BundleContext context) or in a public constructor.
Such code is generated by Eclipse wizard for creating new plug-in. And this is Eclipse pattern for accessing the shared instance…
Actually there are more places where this pattern is used in Eclipse framework and very often it is the only way for obtaining a reference to particular object. Let me discuss those later.