I need to start some TimerTasks at the beginning of my RCP Application.
The problem is that these classes are located in an optional plugin and not in the product defining plugin. Therefore I can not use my LifeCycleHandler to start this timer.
Listening to UIEvents.UILifeCycle.APP_STARTUP_COMPLETE does not help because this class will not be instantiated.
No I tried to set an BundleActivator and start my timer in its start() method but it is never called.
The "Bundle-Activator: xx.xxx.xxx.manager.FtpImportManager" is set as the Activator class and implements BundleActivator.
Any ideas?
Best regards,
Pascal
The Activator start method is only called when something else in the plugin is run, so this is not a suitable place to set up timers.
Use an 'Add-on' defined in a 'fragment.e4xmi'. The class you define for the Add-on will be called early during the RCP startup.
The Add-on constructor will be called early on. If you want to be sure the application is started add an application startup complete event method. A complete Add-on might look like:
public class MyAddon
{
public MyAddon()
{
// Code runs early on during startup
}
@Inject
@Optional
public void applicationStarted(@UIEventTopic(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE) Event event)
{
// Code runs when application start is complete
}
}
This method will be called in the UI thread when the application startup is complete.