Class AbstractRuntimeDebugAwareLaunchDelegate

  • All Implemented Interfaces:
    org.eclipse.debug.core.model.ILaunchConfigurationDelegate, org.eclipse.debug.core.model.ILaunchConfigurationDelegate2

    public abstract class AbstractRuntimeDebugAwareLaunchDelegate
    extends CustomErrorHandlingLaunchDelegate
    Abstract launch delegate that is aware of 1C:Enterprise runtime debug processes.
    • Constructor Detail

      • AbstractRuntimeDebugAwareLaunchDelegate

        public AbstractRuntimeDebugAwareLaunchDelegate()
    • Method Detail

      • attachDebugTarget

        protected String attachDebugTarget​(org.eclipse.debug.core.ILaunchConfiguration configuration,
                                           org.eclipse.debug.core.ILaunch launch,
                                           IResolvableRuntimeInstallation installation,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws org.eclipse.core.runtime.CoreException
        Attach an 1C:Enterprise runtime debug target to the provided ILaunch, using the provded launch configuration attributes.
        Parameters:
        configuration - the launch configuration to use, cannot be null
        launch - the launch to attach debug target to, cannot be null
        installation - the 1C:Enterprise runtime installation to use, cannot be null
        monitor - the progress monitor to report progress to (if necessary), cannot be null
        Returns:
        debug client connection URL (debug server or remote HTTP server URL), never null
        Throws:
        org.eclipse.core.runtime.CoreException - if attaching failed or illegal configuration provided
      • createMatchingRuntimeNotFoundErrorStatus

        protected org.eclipse.core.runtime.IStatus createMatchingRuntimeNotFoundErrorStatus​(int errorCode,
                                                                                            MatchingRuntimeNotFound e)
        Creates an error status with 1C:Enterprise runtime not found exception information.
        Parameters:
        errorCode - the status error code
        e - the matching 1C:Enterprise runtime not found exception, cannot be null
        Returns:
        the created status, never null
      • checkInfobaseExistence

        protected org.eclipse.core.runtime.IStatus checkInfobaseExistence​(InfobaseReference infobase,
                                                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                                                   throws org.eclipse.core.runtime.CoreException
        Checks the infobase existence and returns a status of infobase existence check:
        • OK if infobase exists or was created during check.
        • CANCEL if infobase does not exists and user cancel infobase creation.
        Parameters:
        infobase - the infobase to check, cannot be null
        monitor - the progress monitor to use, cannot be null
        Returns:
        the status of infobase existence check, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if check failed with some reason
      • updateInfobaseDatabase

        protected org.eclipse.core.runtime.IStatus updateInfobaseDatabase​(org.eclipse.core.resources.IProject project,
                                                                          InfobaseReference infobase,
                                                                          boolean deployFull,
                                                                          boolean associateAfterDeploy,
                                                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                                                   throws org.eclipse.core.runtime.CoreException
        Updaptes infobase database structure for the provided project. Return status of infobase database update:
        • OK if infobase is succesfully updated.
        • CANCEL if update was cancelled by the user.
        Parameters:
        project - the project to get configuration for, cannot be null
        infobase - the infobase to update database, cannot be null
        deployFull - whether need to deploy full project configuration
        associateAfterDeploy - whether project will be associated with infobase after project deploy
        monitor - the progress monitor to report progress to, cannot be null
        Returns:
        the status of infobase database structure update, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if update failed with some reason
      • publishInfobase

        protected PublicationResult publishInfobase​(InfobaseReference infobase,
                                                    IResolvableRuntimeInstallation resolvable,
                                                    org.eclipse.core.runtime.IProgressMonitor monitor)
                                             throws org.eclipse.core.runtime.CoreException
        Publishes the provided infobase. Method will return publication result: status of execution and instance of publication, if it was successful.
        Parameters:
        infobase - the infoase to publih, cannot be null
        resolvable - the resolvabe 1C:Enterprise runtime installation to use, cannot be null
        monitor - the progress monitor, cannot be null
        Returns:
        a status of execution and instance of publication, if it was successful, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if request failed
      • getInfobase

        protected InfobaseReference getInfobase​(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                         throws org.eclipse.core.runtime.CoreException
        Returns the infobase from the given launch configuration attributes. Can return null.
        Parameters:
        configuration - the launch configuration to get infobase from, cannot be null
        Returns:
        the infobase or null if not present
        Throws:
        org.eclipse.core.runtime.CoreException - if fails or configuration need to be updated
      • getProject

        protected IV8Project getProject​(org.eclipse.debug.core.ILaunchConfiguration configuration)
                                 throws org.eclipse.core.runtime.CoreException
        Returns the V8 project by the provided launch configuration attributes.
        Parameters:
        configuration - the launch configuration to get V8 project, cannot be null
        Returns:
        the project by the provided launch configuration attributes, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if cannot find project by the provided launch configuration attributes
      • getProject

        protected IV8Project getProject​(String projectName)
                                 throws org.eclipse.core.runtime.CoreException
        Returns the V8 project by the provided project name.
        Parameters:
        projectName - the project name to get V8 project with, cannot be null
        Returns:
        the project by the provided project name or null if not found
        Throws:
        org.eclipse.core.runtime.CoreException - if get failed with some reason
      • getRuntimeComponent

        protected <C extends IRuntimeComponent,​E extends IRuntimeComponentExecutorPair<C,​E> getRuntimeComponent​(IResolvableRuntimeInstallation resolvable,
                                                                                                                              String typeId)
                                                                                                                       throws org.eclipse.core.runtime.CoreException
        Returns the 1C:Enterprise runtime installation component and executor by the provided component type id as pair of target component type instance and target component executor.
        Parameters:
        resolvable - the 1C:Enterprise runtime installation, cannot be null
        typeId - the target component type id, cannot be null
        Returns:
        a pair of target component type instance and target component executor, never null
        Throws:
        org.eclipse.core.runtime.CoreException - if component get fails for some reason
        See Also:
        IRuntimeComponentTypes
      • associate

        protected void associate​(org.eclipse.core.resources.IProject project,
                                 InfobaseReference infobase,
                                 boolean isSynchronized)
        Associates the provided project with the provided infobase, if not associated yet.
        Parameters:
        project - the project to associate, cannot be null
        infobase - the infobase to associate, cannot be null
        isSynchronized - whether the infobase is synchronized with the provided project (configurations are equals)