Class AbstractPDELaunchConfiguration

    • Field Detail

      • fConfigDir

        protected File fConfigDir
      • shouldVMAddModuleSystem

        @Deprecated
        public static boolean shouldVMAddModuleSystem
        Deprecated.
        This field was wrongly added and is no longer used.
        This field will control the addition of argument --add-modules=ALL-SYSTEM in the VM arguments during PDE launch. This VM argument is required from Java9 onwards for launching non-modular system
        Since:
        3.8
        Restriction:
        This field is not intended to be referenced by clients.
    • Constructor Detail

      • AbstractPDELaunchConfiguration

        public AbstractPDELaunchConfiguration()
    • Method Detail

      • getVMRunner

        public IVMRunner getVMRunner​(ILaunchConfiguration configuration,
                                     String mode)
                              throws CoreException
        Returns the VM runner for the given launch mode to use when launching the given configuration.
        Parameters:
        configuration - launch configuration
        mode - launch node
        Returns:
        VM runner to use when launching the given configuration in the given mode
        Throws:
        CoreException - if a VM runner cannot be determined
      • setDefaultSourceLocator

        protected void setDefaultSourceLocator​(ILaunchConfiguration configuration)
                                        throws CoreException
        Assigns a default source locator to the given launch if a source locator has not yet been assigned to it, and the associated launch configuration does not specify a source locator.
        Parameters:
        configuration - configuration being launched
        Throws:
        CoreException - if unable to set the source locator
      • getClasspath

        public String[] getClasspath​(ILaunchConfiguration configuration)
                              throws CoreException
        Returns the entries that should appear on boot classpath.
        Parameters:
        configuration - launch configuration
        Returns:
        the location of startup.jar and the bootstrap classpath specified by the given launch configuration
        Throws:
        CoreException - if unable to find startup.jar
      • getEnvironment

        public String[] getEnvironment​(ILaunchConfiguration configuration)
                                throws CoreException
        Returns an array of environment variables to be used when launching the given configuration or null if unspecified.
        Parameters:
        configuration - launch configuration
        Returns:
        the environment variables to be used when launching or null
        Throws:
        CoreException - if unable to access associated attribute or if unable to resolve a variable in an environment variable's value
      • getWorkingDirectory

        public File getWorkingDirectory​(ILaunchConfiguration configuration)
                                 throws CoreException
        Returns the working directory path specified by the given launch configuration, or null if none.
        Parameters:
        configuration - launch configuration
        Returns:
        the working directory path specified by the given launch configuration, or null if none
        Throws:
        CoreException - if unable to retrieve the attribute
      • getVMSpecificAttributesMap

        public Map<String,​Object> getVMSpecificAttributesMap​(ILaunchConfiguration configuration)
                                                            throws CoreException
        Returns the Map of VM-specific attributes specified by the given launch configuration, or null if none.
        Parameters:
        configuration - launch configuration
        Returns:
        the Map of VM-specific attributes
        Throws:
        CoreException - if unable to retrieve the attribute
      • getVMArguments

        public String[] getVMArguments​(ILaunchConfiguration configuration)
                                throws CoreException
        Returns the VM arguments specified by the given launch configuration, as an array of strings.
        Parameters:
        configuration - launch configuration
        Returns:
        the VM arguments specified by the given launch configuration, possibly an empty array
        Throws:
        CoreException - if unable to retrieve the attribute
      • getProgramArguments

        public String[] getProgramArguments​(ILaunchConfiguration configuration)
                                     throws CoreException
        Returns the program arguments to launch with. This list is a combination of arguments computed by PDE based on attributes specified in the given launch configuration, followed by the program arguments that the entered directly into the launch configuration.
        Parameters:
        configuration - launch configuration
        Returns:
        the program arguments necessary for launching
        Throws:
        CoreException - if unable to retrieve the attribute or create the necessary configuration files
      • preLaunchCheck

        protected void preLaunchCheck​(ILaunchConfiguration configuration,
                                      ILaunch launch,
                                      IProgressMonitor monitor)
                               throws CoreException
        Does sanity checking before launching. The criteria whether the launch should proceed or not is specific to the launch configuration type.
        Parameters:
        configuration - launch configuration
        launch - the launch object to contribute processes and debug targets to
        monitor - a progress monitor
        Throws:
        CoreException - exception thrown if launch fails or canceled or if unable to retrieve attributes from the launch configuration
      • getConfigDir

        protected File getConfigDir​(ILaunchConfiguration configuration)
        Returns the configuration area specified by the given launch configuration.
        Parameters:
        configuration - launch configuration
        Returns:
        the directory path specified by the given launch configuration
      • getMainClass

        public String getMainClass()
        Returns the fully-qualified name of the class to launch.
        Returns:
        the fully-qualified name of the class to launch. Must not return null.
        Since:
        3.3
      • manageLaunch

        protected void manageLaunch​(ILaunch launch)
        Adds a listener to the launch to be notified at interesting launch lifecycle events such as when the launch terminates.
        Parameters:
        launch - the launch
        Since:
        3.3
      • synchronizeManifests

        protected void synchronizeManifests​(ILaunchConfiguration configuration,
                                            IProgressMonitor monitor)
        Checks for old-style plugin.xml files that have become stale since the last launch. For any stale plugin.xml files found, the corresponding MANIFEST.MF is deleted from the runtime configuration area so that it gets regenerated upon startup.
        Parameters:
        configuration - the launch configuration
        monitor - a progress monitor
        Since:
        3.3
      • validateProjectDependencies

        protected void validateProjectDependencies​(ILaunchConfiguration configuration,
                                                   IProgressMonitor monitor)
        Checks if the Automated Management of Dependencies option is turned on. If so, it makes aure all manifests are updated with the correct dependencies.
        Parameters:
        configuration - the launch configuration
        monitor - a progress monitor
        Since:
        3.3
      • clear

        protected void clear​(ILaunchConfiguration configuration,
                             IProgressMonitor monitor)
                      throws CoreException
        By default, this method does nothing. Clients should override, if appropriate.
        Parameters:
        configuration - the launch configuration
        monitor - the progress monitor
        Throws:
        CoreException - if unable to retrieve launch attribute values or the clear operation was cancelled
        Since:
        3.3
      • validatePluginDependencies

        protected void validatePluginDependencies​(ILaunchConfiguration configuration,
                                                  IProgressMonitor monitor)
                                           throws CoreException
        Validates inter-bundle dependencies automatically prior to launching if that option is turned on.
        Parameters:
        configuration - the launch configuration
        monitor - a progress monitor
        Throws:
        CoreException
        Since:
        3.3
      • updatePDELaunchConfigModuleSystem

        @Deprecated
        public static void updatePDELaunchConfigModuleSystem​(boolean java9)
        Deprecated.
        This method was wrongly added and is no longer used. It is a no-op now.
        Updates the field shouldVMAddModuleSystem.
        Since:
        3.8
        Restriction:
        This method is not intended to be referenced by clients.