Class Launcher

java.lang.Object
net.sourceforge.jnlp.Launcher

public class Launcher extends Object
Launches JNLPFiles either in the foreground or background.

An optional LaunchHandler can be specified that is notified of warning and error condition while launching and that indicates whether a launch may proceed after a warning has occurred. If specified, the LaunchHandler is notified regardless of whether the file is launched in the foreground or background.

Version:
$Revision: 1.22 $
Author:
Jon A. Maxwell (JAM) - initial author
  • Constructor Details

    • Launcher

      public Launcher()
  • Method Details

    • setParserSettings

      public void setParserSettings(ParserSettings settings)
      Parameters:
      settings - the parser settings to use when the Launcher initiates parsing of a JNLP file.
    • setInformationToMerge

      public void setInformationToMerge(Map<String,List<String>> input)
      Set a map to use when trying to extract extra information, including arguments, properties and parameters, to be merged into the main JNLP
      Parameters:
      input - a map containing extra information to add to the main JNLP. the values for keys "arguments", "parameters", and "properties" are used.
    • launch

      public ApplicationInstance launch(JNLPFile file) throws LaunchException
      Launches a JNLP file by calling the launch method for the appropriate file type. The application will be started in a new window.
      Parameters:
      file - the JNLP file to launch
      Returns:
      the application instance
      Throws:
      LaunchException - if an error occurred while launching (also sent to handler)
    • launch

      public ApplicationInstance launch(JNLPFile file, Container cont) throws LaunchException
      Launches a JNLP file inside the given container if it is an applet. Specifying a container has no effect for Applications and Installers.
      Parameters:
      file - the JNLP file to launch
      cont - the container in which to place the application, if it is an applet
      Returns:
      the application instance
      Throws:
      LaunchException - if an error occurred while launching (also sent to handler)
    • launch

      public ApplicationInstance launch(URL location) throws LaunchException
      Launches a JNLP file by calling the launch method for the appropriate file type.
      Parameters:
      location - the URL of the JNLP file to launch location to get the pristine version
      Returns:
      the application instance
      Throws:
      LaunchException - if there was an exception