Top Fields Constructors Methods
com.sun.javafx.application

public Class LauncherImpl

extends Object
Class Inheritance
Imports
com.sun.javafx.PlatformUtil, .PreviewFeature, .SecurityUtil, com.sun.javafx.util.Utils, javafx.application.Application, .Preloader, .Preloader.ErrorNotification, .Preloader.PreloaderNotification, .Preloader.StateChangeNotification, javafx.stage.Stage, java.io.File, .IOException, java.lang.reflect.Constructor, .InvocationTargetException, .Method, java.net.URL, .URLClassLoader, java.text.Normalizer, java.util.ArrayList, .LinkedList, .List, .Base64, .Optional, java.util.concurrent.CountDownLatch, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, java.util.jar.Attributes, .JarFile, .Manifest, com.sun.javafx.stage.StageHelper

Field Summary

Modifier and TypeField and Description
private static volatile Throwable
private static Preloader
private static volatile boolean
private static volatile Throwable
public static final String
LAUNCH_MODE_CLASS

When passed as launchMode to launchApplication, tells the method that launchName is the name of the JavaFX application class to launch.

public static final String
LAUNCH_MODE_JAR

When passed as launchMode to launchApplication, tells the method that launchName is a path to a JavaFX application jar file to be launched.

public static final String
LAUNCH_MODE_MODULE

When passed as launchMode to launchApplication, tells the method that launchName is the name of the JavaFX application class within a module to be launched.

private static AtomicBoolean
private static volatile RuntimeException
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static volatile Throwable
private static volatile Throwable
private static volatile Throwable
private static volatile Throwable
private static ClassLoader
private static Class<? extends Preloader>
private static final boolean
private static volatile Throwable
private static volatile Throwable
private static final AtomicBoolean
private static final boolean
private static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
abort(final Throwable cause, final String fmt, final Object... args)

private static String
private static URL
private static String[]
private static Attributes
public static void
launchApplication(final Class<? extends Application>
application class
appClass
,
final String[]
command line arguments
args
)

This method is called by the Application.launch method.

public static void
launchApplication(final Class<? extends Application>
application class
appClass
,
final Class<? extends Preloader>
preloader class, may be null
preloaderClass
,
final String[]
command line arguments
args
)

This method is called by the standalone launcher.

public static void
launchApplication(final String
The path to a jar file, the application class name to launch, or the module and optional class name to launch
launchName
,
final String
The method of launching the application, one of LM_JAR, LM_CLASS, or LM_MODULE
launchMode
,
final String[]
Application arguments from the command line
args
)

This method is called by the Java launcher.

private static void
launchApplication1(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String[] args)

public static void
launchApplicationWithArgs(final ModuleAccess mainModule, final String mainClassName, final String preloaderClassName, String[] args)

private static Class<?>
loadClass(final ModuleAccess mainModule, final String className)

private static void
private static boolean
notifyError(final String msg, final Throwable constructorError)

public static void
private static void
notifyProgress(final Preloader preloader, final double d)

private static void
private static ClassLoader
setupJavaFXClassLoader(File appJar, String fxClassPath)

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constructorErrorback to summary
private static volatile Throwable constructorError
currentPreloaderback to summary
private static Preloader currentPreloader
errorback to summary
private static volatile boolean error
initErrorback to summary
private static volatile Throwable initError
LAUNCH_MODE_CLASSback to summary
public static final String LAUNCH_MODE_CLASS

When passed as launchMode to launchApplication, tells the method that launchName is the name of the JavaFX application class to launch.

LAUNCH_MODE_JARback to summary
public static final String LAUNCH_MODE_JAR

When passed as launchMode to launchApplication, tells the method that launchName is a path to a JavaFX application jar file to be launched.

LAUNCH_MODE_MODULEback to summary
public static final String LAUNCH_MODE_MODULE

When passed as launchMode to launchApplication, tells the method that launchName is the name of the JavaFX application class within a module to be launched. Either the class name will be provided or the main class will be defined in the module's descriptor.

launchCalledback to summary
private static AtomicBoolean launchCalled
launchExceptionback to summary
private static volatile RuntimeException launchException
MF_JAVAFX_ARGUMENT_PREFIXback to summary
private static final String MF_JAVAFX_ARGUMENT_PREFIX
MF_JAVAFX_CLASS_PATHback to summary
private static final String MF_JAVAFX_CLASS_PATH
MF_JAVAFX_MAINback to summary
private static final String MF_JAVAFX_MAIN
MF_JAVAFX_PARAMETER_NAME_PREFIXback to summary
private static final String MF_JAVAFX_PARAMETER_NAME_PREFIX
MF_JAVAFX_PARAMETER_VALUE_PREFIXback to summary
private static final String MF_JAVAFX_PARAMETER_VALUE_PREFIX
MF_JAVAFX_PRELOADERback to summary
private static final String MF_JAVAFX_PRELOADER
MF_MAIN_CLASSback to summary
private static final String MF_MAIN_CLASS
pConstructorErrorback to summary
private static volatile Throwable pConstructorError
pInitErrorback to summary
private static volatile Throwable pInitError
pStartErrorback to summary
private static volatile Throwable pStartError
pStopErrorback to summary
private static volatile Throwable pStopError
savedMainCclback to summary
private static ClassLoader savedMainCcl
savedPreloaderClassback to summary
private static Class<? extends Preloader> savedPreloaderClass
simulateSlowProgressback to summary
private static final boolean simulateSlowProgress
startErrorback to summary
private static volatile Throwable startError
stopErrorback to summary
private static volatile Throwable stopError
toolkitStartedback to summary
private static final AtomicBoolean toolkitStarted
traceback to summary
private static final boolean trace
verboseback to summary
private static final boolean verbose

Constructor Detail

LauncherImplback to summary
private LauncherImpl()

Method Detail

abortback to summary
private static void abort(final Throwable cause, final String fmt, final Object... args)
decodeBase64back to summary
private static String decodeBase64(String inp)
fileToURLback to summary
private static URL fileToURL(File file) throws IOException
getAppArgumentsback to summary
private static String[] getAppArguments(Attributes attrs)
getJarAttributesback to summary
private static Attributes getJarAttributes(String jarPath)
launchApplicationback to summary
public static void launchApplication(final Class<? extends Application> appClass, final String[] args)

This method is called by the Application.launch method. It must not be called more than once or an exception will be thrown. Note that it is always called on a thread other than the FX application thread, since that thread is only created at startup.

Parameters
appClass:Class<? extends Application>

application class

args:String[]

command line arguments

Annotations
@SuppressWarnings:unchecked
launchApplicationback to summary
public static void launchApplication(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String[] args)

This method is called by the standalone launcher. It must not be called more than once or an exception will be thrown. Note that it is always called on a thread other than the FX application thread, since that thread is only created at startup.

Parameters
appClass:Class<? extends Application>

application class

preloaderClass:Class<? extends Preloader>

preloader class, may be null

args:String[]

command line arguments

launchApplicationback to summary
public static void launchApplication(final String launchName, final String launchMode, final String[] args)

This method is called by the Java launcher. This allows us to be launched directly from the command line via "java -jar fxapp.jar", "java -cp path some.fx.App", or "java -m module/some.fx.App". The launchMode argument must be one of "LM_CLASS", "LM_JAR", or "LM_MODULE" or execution will abort with an error.

Parameters
launchName:String

The path to a jar file, the application class name to launch, or the module and optional class name to launch

launchMode:String

The method of launching the application, one of LM_JAR, LM_CLASS, or LM_MODULE

args:String[]

Application arguments from the command line

launchApplication1back to summary
private static void launchApplication1(final Class<? extends Application> appClass, final Class<? extends Preloader> preloaderClass, final String[] args) throws Exception
launchApplicationWithArgsback to summary
public static void launchApplicationWithArgs(final ModuleAccess mainModule, final String mainClassName, final String preloaderClassName, String[] args)
loadClassback to summary
private static Class<?> loadClass(final ModuleAccess mainModule, final String className)
notifyCurrentPreloaderback to summary
private static void notifyCurrentPreloader(final Preloader.PreloaderNotification pe)
notifyErrorback to summary
private static boolean notifyError(final String msg, final Throwable constructorError)
notifyPreloaderback to summary
public static void notifyPreloader(Application app, final Preloader.PreloaderNotification info)
notifyProgressback to summary
private static void notifyProgress(final Preloader preloader, final double d)
notifyStateChangeback to summary
private static void notifyStateChange(final Preloader preloader, final Preloader.StateChangeNotification.Type type, final Application app)
setupJavaFXClassLoaderback to summary
private static ClassLoader setupJavaFXClassLoader(File appJar, String fxClassPath)
startToolkitback to summary
private static void startToolkit() throws InterruptedException