javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java
changeset 48 e0d6e9bd3ca7
parent 21 2a9601315dfc
child 78 71ad690e91f5
child 83 26b2b12093af
equal deleted inserted replaced
47:f40128debb5d 48:e0d6e9bd3ca7
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   160      * for killing the application if it doesn't close itself nicely after
   160      * for killing the application if it doesn't close itself nicely after
   161      * specified grace time. The specified grace time is runtime dependent.
   161      * specified grace time. The specified grace time is runtime dependent.
   162      * <p>
   162      * <p>
   163      * This method is meant ONLY for the UI and no other API are allowed
   163      * This method is meant ONLY for the UI and no other API are allowed
   164      * to use it. The UI must use this API ONLY when the user explicitly
   164      * to use it. The UI must use this API ONLY when the user explicitly
   165      * wants to close the application using some platform depedent feataure
   165      * wants to close the application using some platform dependent feature
   166      * (e.g. red key in S60). If the user tries to close the application
   166      * (e.g. red key in S60). If the user tries to close the application
   167      * using the mechanism provided by the application itself, this method
   167      * using the mechanism provided by the application itself, this method
   168      * must not be called.
   168      * must not be called.
       
   169      * <p>
       
   170      * Note that calling this method might cause the UI framework to call
       
   171      * uiDisposed method, depending on which UI framework is used.
   169      * <p>
   172      * <p>
   170      * This method is a problematic in such runtimes that may run more than one
   173      * This method is a problematic in such runtimes that may run more than one
   171      * application in same JVM instance (e.g. eRCP). If the application
   174      * application in same JVM instance (e.g. eRCP). If the application
   172      * doesn't close nicely the runtime may have to terminate
   175      * doesn't close nicely the runtime may have to terminate
   173      * the whole JVM process, which leads closing all the running applications
   176      * the whole JVM process, which leads closing all the running applications
   174      * and the runtime itself.
   177      * and the runtime itself.
   175      *
   178      *
   176      */
   179      */
   177     public abstract void notifyExitCmd();
   180     public abstract void notifyExitCmd();
       
   181 
       
   182     /**
       
   183      * Notifies the runtime that UI has been disposed. The runtime is
       
   184      * responsible for killing the application if it doesn't close itself
       
   185      * nicely after specified grace time. The specified grace time is
       
   186      * runtime dependent.
       
   187      * <p>
       
   188      * This method is meant ONLY for the UI and no other API are allowed
       
   189      * to use it.
       
   190      * <p>
       
   191      * It is possible that the method is called several times from different 
       
   192      * phases of the UI exit sequence. 
       
   193      */
       
   194     public void uiDisposed()
       
   195     {
       
   196         notifyExitCmd();
       
   197     }
   178 
   198 
   179     /**
   199     /**
   180      * Determines whether the access request indicated by the specified
   200      * Determines whether the access request indicated by the specified
   181      * permission should be allowed or denied, based on the security policy
   201      * permission should be allowed or denied, based on the security policy
   182      * currently in effect. This method quietly returns if the access request
   202      * currently in effect. This method quietly returns if the access request
   219      * There can be more than one listener.
   239      * There can be more than one listener.
   220      *
   240      *
   221      * @param listener the new listener.
   241      * @param listener the new listener.
   222      */
   242      */
   223     public void addShutdownListener(ShutdownListener listener)
   243     public void addShutdownListener(ShutdownListener listener)
   224 {
   244     {
   225         if (mListeners == null)
   245         if (mListeners == null)
   226         {
   246         {
   227             mListeners = new Vector();
   247             mListeners = new Vector();
   228         }
   248         }
   229         mListeners.addElement(listener);
   249         mListeners.addElement(listener);