Hi *,
I have the JDK5 special exceptionHandler which forces a shutdown when a given exception is thrown:
I also have implemented a method in DefaultApplicationLifecycleAdvisor to ask the user if they are sure that they want to close the window...Code:<bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate"> <property name="throwableClass" value="java.lang.Throwable" /> <property name="exceptionHandler"> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler"> <property name="logLevel" value="ERROR" /> <property name="shutdownPolicy" value="ASK" /> <property name="issueReporter" ref="issueReporter" /> </bean> </property> </bean>
When an unexpected exception is thrown, the following happen:Code:@Override public boolean onPreWindowClose(final ApplicationWindow window) { ...
1/ The user is notified by the exceptionHandler that the application is going to close (OK!)
2/ The onPreWindowClose is then called and the user is asked whether they want to shutdown... a) they should not have the choice and b) the choice is ignored anyway.
How could I know in my onPreWindowClose that the application is in a forced shutdown mode? and hence not ask the question...
Many thanks
Benoit.


Reply With Quote
