Class AbstractRuntimeComponentExecutor

    • Constructor Detail

      • AbstractRuntimeComponentExecutor

        public AbstractRuntimeComponentExecutor()
    • Method Detail

      • needComponent

        public boolean needComponent()
        Description copied from interface: IRuntimeComponentExecutor
        Returns whether instance of 1C:Enterprise component is needed for execution. Some of executor implementations requires compoment for execution actions: for example, executable files launching.
        Specified by:
        needComponent in interface IRuntimeComponentExecutor
        Returns:
        whether instance of 1C:Enterprise component is needed for execution
      • executeRuntimeProcessCommand

        protected String executeRuntimeProcessCommand​(RuntimeExecutionCommandBuilder command,
                                                      RuntimeInstallation installation,
                                                      InfobaseReference infobase,
                                                      RuntimeExecutionArguments arguments)
                                               throws RuntimeExecutionException,
                                                      RuntimeVersionRequiredException
        Execute given 1C:Enterprise runtime process command and log execution messages to file. Method will create temporary log file and append log file usage to given command.

        If 1C:Enterprise runtime process will be executed unsuccessfully, log file will be read after process execution and RuntimeExecutionException will be thrown with full log file content.

        Log file will be read and deleted after method execution. Method returns entire log content.

        Parameters:
        command - the command builder to execute command with, cannot be null
        installation - the owner 1C:Enterprise runtime installation instance can be null
        arguments - execution arguments, can be null, then will not be used
        Throws:
        RuntimeExecutionException - if runtime process fails with some reason
        RuntimeVersionRequiredException - if execution of 1C:Etenprise runtime was processed from illegal 1C:Enterprise runtime version; exception holds information about required version for this execution
      • readRuntimeLog

        protected String readRuntimeLog​(File logFile,
                                        RuntimeInstallation installation)
                                 throws IOException
        Reads and returns entire 1C:Enterprise runtime execution log content.
        Parameters:
        logFile - the log file to read, cannot be null
        installation - the owner 1C:Enterprise runtime installation instance can be null
        Returns:
        the entire 1C:Enterprise runtime execution log content, never null
        Throws:
        IOException - if an I/O error occurred
      • appendClientArguments

        protected <T extends AbstractExecutionCommandBuilder<T>> void appendClientArguments​(T command,
                                                                                            RuntimeExecutionArguments arguments)
        Append 1C:Enterprise client arguments to constructing 1C:Enterprise runtime command builder.
        Parameters:
        command - the constructing command to append to, cannot be null
        arguments - the arguments to append, cannot be null
      • appendRuntimeClientArguments

        protected void appendRuntimeClientArguments​(RuntimeExecutionCommandBuilder command,
                                                    RuntimeExecutionArguments arguments)
        Append 1C:Enterprise runtime client arguments to constructing 1C:Enterprise runtime command builder.
        Parameters:
        command - the constructing command to append to, cannot be null
        arguments - the arguments to append, cannot be null
      • appendExtensionCustomization

        protected void appendExtensionCustomization​(RuntimeExecutionCommandBuilder commandBuilder,
                                                    RuntimeExecutionArguments arguments)
        Append configuration extension customization to constructing 1C:Enterprise runtime command builder, if they exists in given arguments.
        Parameters:
        commandBuilder - constructing 1C:Enterprise command builder, cannot be null
        arguments - 1C:Enterprise runtime execution arguments, can be null, then will not be appended
      • appendInfobaseAccess

        protected <T extends AbstractExecutionCommandBuilder<T>> void appendInfobaseAccess​(T commandBuilder,
                                                                                           RuntimeExecutionArguments arguments)
        Append infobase access options (user name and user password parameters or OS authentication) to constructing 1C:Enterprise runtime command builder, if they exists in given arguments.
        Parameters:
        commandBuilder - constructing 1C:Enterprise command builder, cannot be null
        arguments - 1C:Enterprise runtime execution arguments, can be null, then will not be appended
      • splitInfobaseConnection

        protected boolean splitInfobaseConnection()
        Returns whether need to split infobase name from infobase command option in infobase connection option.
        Returns:
        whether need to split infobase name from infobase command option
      • createTempFile

        protected File createTempFile()
                               throws IOException
        Create temporary file. The caller is responsible for file deletion.
        Returns:
        the created ready-to-use temporary file, never null
        Throws:
        IOException - if an I/O error occurred