[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[wtp-dev] Couple WTP Questions
|
Hi, I have a couple questions that I hope someone can help me with concerning the
WTP code in Galileo so that I don't end up doing anything nonsensical:
1. I notice that the "public abstract void stop(boolean force)" method in the
abstract class ServerBehaviourDelegate.java does not throw a CoreException.
Similarly, I notice that the stopImpl2(boolean force) method in Server.java wraps
the stop() method in a try/catch. See below:
try {
getBehaviourDelegate(null).stop(force);
} catch (RuntimeException e) {
Trace.trace(Trace.SEVERE, "Error calling delegate stop() " +
Server.this.toString(), e);
throw e;
} catch (Throwable t) {
Trace.trace(Trace.SEVERE, "Error calling delegate stop() " +
Server.this.toString(), t);
throw new RuntimeException(t);
}
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).
2. Again I notice that the setupLaunchConfiguration() method in the abstract
class ServerBehaviourDelegate.java does throw a CoreException, but in the
Server.java 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).
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy
workingCopy, IProgressMonitor monitor) {
try {
getBehaviourDelegate(monitor).setupLaunchConfiguration(workingCopy,
monitor);
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error calling delegate
setupLaunchConfiguration() " + toString(), e);
}
}
So my question in this case is this: If the CoreException thrown by the client is
essentially ignored by WTP is there something else the client should or must do
in addition to throwing the CoreException ?? I just want to be certain that the
user on the client-side gets a useful/proper indication like an error dialog when
they try to start the a server but an exception occurs. Should the client in this
case display their own Error Message dialog ??
Thanks much for any assistance !!!
--
Thanks,
Tim McConnell