Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Couple WTP Questions

Hi Rob, thanks very much for the quick reply. We are in fact getting an error dialog when I inject an exception during the stop process on our client side -- so that is awesome enough for me. Also appreciate your suggestion for question two -- it never occurred to me to try it this way but seems like a good and simple technique for us to try.

Thanks much !!

Rob Stryker wrote:
Tim McConnell wrote:
So my question is this: If the client-side's implementation of ServerBehaviourDelegate gets an exception while invoking their stop(force) method is it recommended that the client throw a RuntimeException() so that it gets caught by WTP ?? It's seem obvious to me that this is the case, but I would just like to ensure that this is a good technique to employ (i.e., WTP will properly handle the RuntimeException).
stopImpl2 is called by stopImpl, which is called by (which is a Job). The rethrowing of the exception means the Job will be terminated. I believe an error dialog will come up, but not an orderly one. You may wish to file an API request on the server tools plugin at bugzilla if you think this is not awesome ;)

2. Again I notice that the setupLaunchConfiguration() method in the abstract class does throw a CoreException, but in the when a server delegate gets an exception while invoking their own setupLaunchConfiguration implementation and subsequently throws a CoreException, it essentially gets ignored except for the Trace message (below).
I believe the server ignores the exception and proceeds to try to launch the launch configuration anyway. One way to work around this is to have your server have its own launch configuration type. When the request comes to your serverLaunchConfigType to launch itself, it can check to make sure it's been set up properly. In this case, during the setup method, when you catch the exception, you'd set an attribute on the config that says setup failed, and when asked to launch, you'll check for this and throw a core exception.

ILaunchConfigurationDelegate contains the following:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException;

wtp-dev mailing list

Tim McConnell

Back to the top