You can start a plug-in when a specific Eclipse application is started.
In the majority of cases, plug-ins that are exporting packages for use by other plug-ins, and contain the Bundle-ActivationPolicy: lazy
(or Eclipse-LazyStart: true
) attribute, are started automatically by the framework when there are requests for a class from that plug-in. In cases where a plug-in does not provide packages for use by other plug-ins, or the plug-in needs to start prior to later package references, use the com.ibm.rcp.lifecycle.application.startBundles extension point to associate a plug-in with an Eclipse application. The Eclipse application must use the com.ibm.rcp.lifecycle.application.BundleControl API to process the extension point information and start the requested bundles. Refer to the com.ibm.rcp.lifecycle.application.BundleControl Javadoc in for this class for more information and short sample code. The default application used by the client platform (com.ibm.rcp.personality.framework.RCPApplication) supports use of this extension point.
To contribute a plug-in to the application life cycle:
- Identify the target application (com.ibm.rcp.personality.framework.RCPApplication is the ID of the default application).
- Add an extension point to the bundle containing the application, add the extension point to the bundle containing the service, or add or modify some other bundle to add the extension point.
The plug-in starts when the target application is started.
A plug-in that needs to start DB2® Everyplace® could define the following extension to start the com.ibm.db2e plug-in when the com.ibm.rcp.personality.framework.RCPApplication starts:
<?xml version="1.0" encoding="UTF-8"?>
Platform users using the default com.ibm.rcp.personality.framework.RCPApplication can associate additional plug-ins to be started, as shown in the example above, and do not need to provide their own application. If the platform is not using the default application, plug-ins will need to be associated with the application used to start the platform. Bundles may be associated with more than one application. Since only one Eclipse application is used at startup, only the plug-ins associated with that application will be started.
Parent topic: Managing life cycle: XPD621