< prev index next >

modules/javafx.graphics/src/main/java/com/sun/javafx/application/LauncherImpl.java

Print this page
rev 10897 : 8199357: Remove references to applets and Java Web Start from FX
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 85,95 **** private static final String MF_MAIN_CLASS = "Main-Class"; private static final String MF_JAVAFX_MAIN = "JavaFX-Application-Class"; private static final String MF_JAVAFX_PRELOADER = "JavaFX-Preloader-Class"; private static final String MF_JAVAFX_CLASS_PATH = "JavaFX-Class-Path"; - private static final String MF_JAVAFX_FEATURE_PROXY = "JavaFX-Feature-Proxy"; private static final String MF_JAVAFX_ARGUMENT_PREFIX = "JavaFX-Argument-"; private static final String MF_JAVAFX_PARAMETER_NAME_PREFIX = "JavaFX-Parameter-Name-"; private static final String MF_JAVAFX_PARAMETER_VALUE_PREFIX = "JavaFX-Parameter-Value-"; // Set to true to simulate a slow download progress --- 85,94 ----
*** 244,254 **** } /* * For now, just open the jar and get JavaFX-Application-Class and * JavaFX-Preloader and pass them to launchApplication. In the future ! * we'll need to load requested jar files and set up the proxy */ String mainClassName = null; String preloaderClassName = null; String[] appArgs = args; ClassLoader appLoader = null; --- 243,253 ---- } /* * For now, just open the jar and get JavaFX-Application-Class and * JavaFX-Preloader and pass them to launchApplication. In the future ! * we'll need to load requested jar files */ String mainClassName = null; String preloaderClassName = null; String[] appArgs = args; ClassLoader appLoader = null;
*** 280,295 **** */ appLoader = setupJavaFXClassLoader(new File(launchName), fxClassPath); } } - // Support JavaFX-Feature-Proxy (only supported setting is 'auto', anything else is ignored) - String proxySetting = jarAttrs.getValue(MF_JAVAFX_FEATURE_PROXY); - if (proxySetting != null && "auto".equals(proxySetting.toLowerCase())) { - trySetAutoProxy(); - } - // process arguments and parameters if no args have been passed by the launcher if (args.length == 0) { appArgs = getAppArguments(jarAttrs); } --- 279,288 ----
*** 579,648 **** } } return null; } - private static void trySetAutoProxy() { - // if explicit proxy settings are proxided we will skip autoproxy - // Note: we only check few most popular settings. - if (System.getProperty("http.proxyHost") != null - || System.getProperty("https.proxyHost") != null - || System.getProperty("ftp.proxyHost") != null - || System.getProperty("socksProxyHost") != null) { - if (verbose) { - System.out.println("Explicit proxy settings detected. Skip autoconfig."); - System.out.println(" http.proxyHost=" + System.getProperty("http.proxyHost")); - System.out.println(" https.proxyHost=" + System.getProperty("https.proxyHost")); - System.out.println(" ftp.proxyHost=" + System.getProperty("ftp.proxyHost")); - System.out.println(" socksProxyHost=" + System.getProperty("socksProxyHost")); - } - return; - } - if (System.getProperty("javafx.autoproxy.disable") != null) { - if (verbose) { - System.out.println("Disable autoproxy on request."); - } - return; - } - - try { - Class sm = Class.forName("com.sun.deploy.services.ServiceManager"); - Class params[] = {Integer.TYPE}; - Method setservice = sm.getDeclaredMethod("setService", params); - String osname = System.getProperty("os.name"); - - String servicename; - if (osname.startsWith("Win")) { - servicename = "STANDALONE_TIGER_WIN32"; - } else if (osname.contains("Mac")) { - servicename = "STANDALONE_TIGER_MACOSX"; - } else { - servicename = "STANDALONE_TIGER_UNIX"; - } - Object values[] = new Object[1]; - Class pt = Class.forName("com.sun.deploy.services.PlatformType"); - values[0] = pt.getField(servicename).get(null); - setservice.invoke(null, values); - - Class dps = Class.forName( - "com.sun.deploy.net.proxy.DeployProxySelector"); - Method m = dps.getDeclaredMethod("reset", new Class[0]); - m.invoke(null, new Object[0]); - - if (verbose) { - System.out.println("Autoconfig of proxy is completed."); - } - } catch (Exception e) { - if (verbose) { - System.err.println("Failed to autoconfig proxy due to "+e); - } - if (trace) { - e.printStackTrace(); - } - } - } - private static String decodeBase64(String inp) throws IOException { return new String(Base64.getDecoder().decode(inp)); } private static String[] getAppArguments(Attributes attrs) { --- 572,581 ----
*** 973,993 **** } } } } finally { PlatformImpl.removeListener(listener); - // Workaround until RT-13281 is implemented - // Don't call exit if we detect an error in javaws mode - // PlatformImpl.tkExit(); - final boolean isJavaws = System.getSecurityManager() != null; - if (error && isJavaws) { - System.err.println("Workaround until RT-13281 is implemented: keep toolkit alive"); - } else { PlatformImpl.tkExit(); } } - } private static void notifyStateChange(final Preloader preloader, final StateChangeNotification.Type type, final Application app) { --- 906,918 ----
*** 1031,1062 **** if (launchCalled.get()) { // Standalone launcher mode notifyCurrentPreloader(info); return; } - - synchronized (LauncherImpl.class) { - if (notifyMethod == null) { - final String fxPreloaderClassName = - "com.sun.deploy.uitoolkit.impl.fx.FXPreloader"; - try { - Class fxPreloaderClass = Class.forName(fxPreloaderClassName); - notifyMethod = fxPreloaderClass.getMethod( - "notifyCurrentPreloader", PreloaderNotification.class); - } catch (Exception ex) { - ex.printStackTrace(); - return; - } - } - } - - try { - // Call using reflection: FXPreloader.notifyCurrentPreloader(pe) - notifyMethod.invoke(null, info); - } catch (Exception ex) { - ex.printStackTrace(); - } } // Not an instantiable class. private LauncherImpl() { // Should never get here. --- 956,965 ----
< prev index next >