IAppServerClass.Refresh

Syntax

Refresh(Instance: String): AppServerState;

Parameters

Instance. Identifier of the launched instance of the task scheduler. The name of the XML file that contains task scheduler settings should be set as a value of the parameter. If an empty string is specified, the task scheduler launched with settings from the Scheduler.xml file is updated.

NOTE. Files of settings for task scheduler startup should be stored in the folder with installed Foresight  Analytics Platform. Name of the file in this parameter is set without the quot;xmlquot; extension.

Description

The Refresh method updates settings of running task scheduler and returns the result of update.

Comments

On executing the method the availability of the launched task scheduler with the specified settings is checked. If the task scheduler is launched, versions of the settings with which the launch was performed and settings in the file are checked. The task scheduler is restarted if there is the latest version of settings in the file.

Example

Executing the example requires a running task scheduler. The task scheduler must be launched with the settings contained in the Test.xml file.

Sub UserProc;
Var
    AppSvr: IAppServerClass;
    State: AppServerState;
Begin
    AppSvr := New AppServerClass.Create;
    State := AppSvr.Refresh("Test");
    Select Case State
        Case AppServerState.Refreshed:
            Debug.WriteLine("Tasks scheduler settings are updated");
        Case AppServerState.Running:
            Debug.WriteLine("Settings file is not changed. Update is not performed");
        Case AppServerState.Unknown:
            Debug.WriteLine("Tasks container launched with specified settings is not found");
    End Select;
End Sub UserProc;

Settings with which the task scheduler is launched are checked on executing the example. If the settings file was changed, the server is restarted. The result of update is displayed in the development environment console.

See also:

IAppServerClass