|Re: [equinox-dev] Using Equinox Hooks for handling application starting?|
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=178927 for an enhancement request that is similar to what you require.
The Equinox Hook (AdaptorHook.startFramework method) will not be sufficient for implementing this. You can get the command line by using the EnvironmentInfo service in you hook. You are passed a BundleContext which you could use to get the EnvironmentInfo service. This service has the methods you need to get the command line arguments. But there is no way from the startFramework method to tell the platform not to start the application. When Eclipse RCP is launched it is configured with an application to launch. You still want this application to be configured to launch in case there is no running instance of your application yet. So even though you processed the command line in your adaptor hook and communicated with another running instance the platform will continue to boot and attempt to start your application. At that point your application could determine that a command line was used to communicate with another instance and return immediately. If you already have to enter your application each time then you might as well just put all the TCP client/server logic directly in your application and have it determine whether it should pass the information off to another running instance of your application and return immediately or process the request directly because it is the first running instance of the application.
Jens Goldhammer ---02/03/2009 05:46:40 AM---Hello,
Jens Goldhammer <goldhammerdev@xxxxxxxxxxxxxx>
02/03/2009 05:46 AM
[equinox-dev] Using Equinox Hooks for handling application starting?