// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package net.sourceforge.jnlp.runtime;
// import java.awt.Window;
import java.io.File;
import java.net.URL;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.CodeSource;
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;
// FIXME replace - currently unused
// import javax.swing.event.EventListenerList;
import net.sourceforge.jnlp.JNLPFile;
import net.sourceforge.jnlp.PropertyDesc;
import net.sourceforge.jnlp.SecurityDesc;
import net.sourceforge.jnlp.ShortcutDesc;
import net.sourceforge.jnlp.config.DeploymentConfiguration;
// FIXME replace - currently unused
// import net.sourceforge.jnlp.event.ApplicationEvent;
// import net.sourceforge.jnlp.event.ApplicationListener;
import net.sourceforge.jnlp.security.SecurityDialogs;
import net.sourceforge.jnlp.security.SecurityDialogs.AccessType;
import net.sourceforge.jnlp.util.logging.OutputController;
import net.sourceforge.jnlp.util.WeakList;
import net.sourceforge.jnlp.util.XDesktopEntry;
/**
* Represents a running instance of an application described in a
* JNLPFile. This class provides a way to track the application's
* resources and destroy the application.
*
* @author Jon A. Maxwell (JAM) - initial author
* @version $Revision: 1.15 $
*/
public class ApplicationInstance {
// todo: should attempt to unload the environment variables
// installed by the application.
/** the file */
private final JNLPFile file;
/** the thread group */
private final ThreadGroup group;
/** the classloader */
private final ClassLoader loader;
/** whether or not this application is signed */
private final boolean isSigned;
/**
* Every application/applet gets its own AppContext. This allows us to do
* things like have two different look and feels for two different applets
* (running in the same VM), allows untrusted programs to manipulate the
* event queue (safely) and (possibly) more.
*
* It is set to the AppContext which created this ApplicationInstance
*
* Either {@link sun.awt.AppContext} or ..
*
* FIXME: Add proper interface
*/
private final Object appContext;
/** whether the application has stopped running */
private boolean stopped = false;
/** weak list of UI window objects opened by the application */
private WeakList