Class AbstractApplicationActivator
java.lang.Object
com.amalgamasimulation.desktop.appelements.application.AbstractApplicationActivator
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
public abstract class AbstractApplicationActivator
extends Object
implements org.osgi.framework.BundleActivator
Base activator for the application bundle. On bundle start it creates
RedrawRestrictionManager, IAppInfo and ICommandFactory and registers them as
OSGi services, so parts and handlers get them through injection.
The platform registers these services because its own classes use them: AbstractTreePart injects RedrawRestrictionManager, BottomStatusBar injects IAppInfo and AbstractPagesPart injects ICommandFactory.
How to use
Set the subclass as Bundle-Activator in MANIFEST.MF and implement createAppInfo(). To replace the command factory, override createCommandFactory(). Register the application services in registerServices().By default IAppInfo is registered only under the IAppInfo name. If the application extends IAppInfo with its own methods, its classes inject their own type, for example MyAppInfo, to call those methods. In that case override getAppInfoKeys() and return both names: e4 looks up a service by the name of the injected type, so without the MyAppInfo name such an injection does not find the service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract com.amalgamasimulation.desktop.utils.IAppInfoprotected ICommandFactoryprotected com.amalgamasimulation.desktop.utils.IAppInfoprotected String[]protected ICommandFactoryprotected RedrawRestrictionManagerprotected voidregisterServices(org.osgi.framework.BundleContext context) voidstart(org.osgi.framework.BundleContext context) voidstop(org.osgi.framework.BundleContext context)
-
Constructor Details
-
AbstractApplicationActivator
public AbstractApplicationActivator()
-
-
Method Details
-
start
- Specified by:
startin interfaceorg.osgi.framework.BundleActivator- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.osgi.framework.BundleActivator- Throws:
Exception
-
createAppInfo
protected abstract com.amalgamasimulation.desktop.utils.IAppInfo createAppInfo() -
createCommandFactory
-
getAppInfoKeys
-
registerServices
- Throws:
Exception
-
getRedrawRestrictionManager
-
getAppInfo
protected com.amalgamasimulation.desktop.utils.IAppInfo getAppInfo() -
getCommandFactory
-