diff -r e5618cc85d74 -r 6c158198356e javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Thu Jul 15 18:31:06 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Thu Aug 19 09:48:13 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -162,11 +162,14 @@ *

* This method is meant ONLY for the UI and no other API are allowed * to use it. The UI must use this API ONLY when the user explicitly - * wants to close the application using some platform depedent feataure + * wants to close the application using some platform dependent feature * (e.g. red key in S60). If the user tries to close the application * using the mechanism provided by the application itself, this method * must not be called. *

+ * Note that calling this method might cause the UI framework to call + * uiDisposed method, depending on which UI framework is used. + *

* This method is a problematic in such runtimes that may run more than one * application in same JVM instance (e.g. eRCP). If the application * doesn't close nicely the runtime may have to terminate @@ -177,6 +180,23 @@ public abstract void notifyExitCmd(); /** + * Notifies the runtime that UI has been disposed. The runtime is + * responsible for killing the application if it doesn't close itself + * nicely after specified grace time. The specified grace time is + * runtime dependent. + *

+ * This method is meant ONLY for the UI and no other API are allowed + * to use it. + *

+ * It is possible that the method is called several times from different + * phases of the UI exit sequence. + */ + public void uiDisposed() + { + notifyExitCmd(); + } + + /** * Determines whether the access request indicated by the specified * permission should be allowed or denied, based on the security policy * currently in effect. This method quietly returns if the access request @@ -221,7 +241,7 @@ * @param listener the new listener. */ public void addShutdownListener(ShutdownListener listener) -{ + { if (mListeners == null) { mListeners = new Vector();