< 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 +1,7 @@
/*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * 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,11 +85,10 @@
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
@@ -244,11 +243,11 @@
}
/*
* 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
+ * we'll need to load requested jar files
*/
String mainClassName = null;
String preloaderClassName = null;
String[] appArgs = args;
ClassLoader appLoader = null;
@@ -280,16 +279,10 @@
*/
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);
}
@@ -579,70 +572,10 @@
}
}
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) {
@@ -973,21 +906,13 @@
}
}
}
} 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) {
@@ -1031,32 +956,10 @@
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.
< prev index next >