The code I would like to run would initialize listeners and start new threads. For instance, if a file has been in the command line arguments, this file would be opened and run.
I already did some tests with @PostContextCreate and @ProcessAdditions. The problem is that when these methods are called, the workbench is not ready yet.
My guess is that I would need to register to IEventBroker for some events such that when the main window has been opened. There is a few things on the life cycle of a part in the tutorials from Vogella on e4 but nothing about the lifecycle of the shell, the workbench or the main window.