Class DevelServerLaunchConfigurationDelegate

All Implemented Interfaces:
IDebugEventSetListener, ILaunchConfigurationDelegate, ILaunchConfigurationDelegate2

public class DevelServerLaunchConfigurationDelegate extends AbstractJavaLaunchConfigurationDelegate
The IIZI Development Server delegate launcher.

This delegate is used for the IIZI Development Server to verify that the configuration is still valid as the configuration file resides separately, loads various configurations from it and then launches the Java VM with the JettyRunConfiguration class.

Author:
Christopher Mindus
  • Constructor Details

    • DevelServerLaunchConfigurationDelegate

      public DevelServerLaunchConfigurationDelegate()
      Constructor.
  • Method Details

    • getLastLaunchedServerConfigUnsecuredPort

      public static int getLastLaunchedServerConfigUnsecuredPort()
      Gets the first unsecure port used for iiziServer that was last used in a launch configuration.
      Returns:
      The port number, or -1 for none.
    • preLaunchCheck

      public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
      Returns whether a launch should proceed. This method is called first in the launch sequence providing an opportunity for this launch delegate to abort the launch.
      Specified by:
      preLaunchCheck in interface ILaunchConfigurationDelegate2
      Overrides:
      preLaunchCheck in class AbstractJavaLaunchConfigurationDelegate
      Parameters:
      configuration - Configuration being launched.
      mode - Launch mode.
      monitor - The progress monitor, or null.
      Returns:
      Whether the launch should proceed.
      Throws:
      CoreException - If an exception occurs while performing pre-launch checks.
    • buildForLaunch

      public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
      Optionally performs any required building before launching the given configuration in the specified mode, and returns whether the debug platform should perform an incremental workspace build before the launch continues. If false is returned the launch will proceed without further building, and if true is returned an incremental build will be performed on the workspace before launching.

      This method is only called if the launch is invoked with flag indicating building should take place before the launch. This is done via the method ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build).

      Specified by:
      buildForLaunch in interface ILaunchConfigurationDelegate2
      Overrides:
      buildForLaunch in class LaunchConfigurationDelegate
      Parameters:
      configuration - The configuration being launched.
      mode - Launch mode.
      monitor - The Progress monitor, or null.
      Returns:
      Whether the debug platform should perform an incremental workspace build before the launch.
      Throws:
      CoreException - If an exception occurs while building.
    • finalLaunchCheck

      public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException
      Returns whether a launch should proceed. This method is called after preLaunchCheck() and buildForLaunch() providing a final chance for this launch delegate to abort a launch if required. For example, a delegate could cancel a launch if it discovered compilation errors that would prevent the launch from succeeding.
      Specified by:
      finalLaunchCheck in interface ILaunchConfigurationDelegate2
      Overrides:
      finalLaunchCheck in class LaunchConfigurationDelegate
      Parameters:
      configuration - The configuration being launched.
      mode - Launch mode.
      monitor - The Progress monitor, or null.
      Returns:
      Whether the launch should proceed.
      Throws:
      CoreException - If an exception occurs during final checks.
    • launch

      public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException
      Launches the given configuration in the specified mode, contributing debug targets and/or processes to the given launch object. The launch object has already been registered with the launch manager.
      Parameters:
      configuration - The configuration to launch.
      mode - The mode in which to launch, one of the mode constants defined by ILaunchManager, i.e. RUN_MODE or DEBUG_MODE.
      launch - The launch object to contribute processes and debug targets to.
      monitor - The progress monitor, or null progress monitor, or null.
      Throws:
      CoreException - If launching fails.