ApplicationServer

Overview

The ApplicationServer class provides base application startup infrastructure including Windows Service management and single instance checks.

The ApplicationServer class is designed to provide a common codebase and simplify development of Remoting SDK and Data Abstract-based server applications. This class provides the following features:

  • 3 application run modes - GUI mode (WinForms or WPF), command-line interface or Windows Service
  • Windows Service management (installation/deinstallation)
  • Optional Single Instance check
  • Extensible startup arguments parser. The ApplicationServer class provides overridable method to handle command-line arguments not handled by default arguments parser. Also it is possible to use own implementation of the IArgumentParser interface.
  • Single exception intercept point (useful for logging etc)

By default ApplicationServer-based applications recognize following command-line arguments (not case-sensitive): {| class="dashed-table" ! style="width: 40% " |

Parameters
! style="width: 60% " |
Description
|- | -I, /I, --INSTALL | Install service |- | -U, /U, --UNINSTALL | Install service |- | -Q, /Q, --QUIET | Suppress messages on service installation and uninstallation |- | -C, /C, --COMMANDLINE | Run in CLI mode |- | -D, /D, --DEBUG | Request extended debug info (ie full stacktraces) |- | -H, /H, -?, /? | Show command-line arguments help message |}

You don't have to write any code to handle these actions.

Here is the example how the ApplicationServer class is used in the Wizard-generated Data Abstract server project:

class SimpleProjectServer : ApplicationServer
{
    private Engine fConsoleEngine;

    protected override String Identifier
    {
        get
        {
            return "2a42e444-5b2c-4f5c-b73a-dd1cab801c0a";
        }
    }

    protected override String ServiceName
    {
        get
        {
            return "SimpleProject Service";
        }
    }

    protected override String ApplicationName
    {
        get
        {
            return "SimpleProject";
        }
    }

    protected override void RunAsConsoleApplication()
    {
        this.fConsoleEngine = new Engine();
        this.fConsoleEngine.Start();
    }

    protected override void ShutdownAsConsoleApplication()
    {
        this.fConsoleEngine.Stop();
        this.fConsoleEngine.Dispose();
    }

    protected override void RunAsWindowsService()
    {
        ServiceBase.Run(new MainService());
    }

    protected override void RunAsWindowsApplication()
    {
        Application.EnableVisualStyles();
        Application.Run(new MainForm());
    }
}

[STAThread]
public static void Main(String[] args)
{
    new SimpleProjectServer().Run(args);
}

Note: The ApplicationServer class (along with its inheritors) can be suitable for common scenarious. If application-specific startup parameters should be handled (f.e. --in-memory switch that activates pure in-memory mode for the Olympia Server) they can be handled via Extended Parameters (see the ProcessExtendedParameters method descriptions).

The ApplicationServer class is widely used used in Remoting SDK and Data Abstract for .NET. For instance Relativity Server, Olympia Server and RO ZeroConf Hub use this class to perform startup actions. Also all Data Abstract for .NET templates use this class as application base.

Location

  • Reference: RemObjects.SDK.Server.dll
  • Namespace: RemObjects.SDK.Server
  • Platforms: .NET Core, .NET Framework, .NET Standard


 

constructor  protected

Creates a new instance of the ApplicationServer class.

This constructor can be called only from an inherited class.

 

constructor

 

ApplicationServer()

 

init()

 

Sub New()

constructor (String, String, String, String, array of Type)

 

constructor(applicationName: String; rodlNamespace: String; serviceName: String; serviceDescription: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, String rodlNamespace, String serviceName, String serviceDescription, params Type[] serviceTypes)

 

init(_ applicationName: String, _ rodlNamespace: String, _ serviceName: String, _ serviceDescription: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, rodlNamespace As String, serviceName As String, serviceDescription As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • rodlNamespace:
  • serviceName:
  • serviceDescription:
  • serviceTypes:

constructor (String, String, array of Type)

 

constructor(applicationName: String; rodlNamespace: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, String rodlNamespace, params Type[] serviceTypes)

 

init(_ applicationName: String, _ rodlNamespace: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, rodlNamespace As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • rodlNamespace:
  • serviceTypes:

constructor (String, array of Type)

 

constructor(applicationName: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, params Type[] serviceTypes)

 

init(_ applicationName: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • serviceTypes:

ApplicationInfo  protected

Gets brief additional info (like copyrights etc) about the application.

This property is used by the help command output as well as in the console mode.

For example for the Relativity server this property returns Please visit http://wiki.remobjects.com/wiki/Relativity to get more information.

The default value of this property is an empty string.

 

property ApplicationInfo: String read;

 

String ApplicationInfo { get; }

 

var ApplicationInfo: String { get{} }

 

ReadOnly Property ApplicationInfo() As String

ApplicationName  protected

Gets full application name, for example RemObjects Data Abstract Relativity Server.

This is abstract property so it should be overriden.

 

property ApplicationName: String read;

 

String ApplicationName { get; }

 

var ApplicationName: String { get{} }

 

ReadOnly Property ApplicationName() As String

ApplicationServerException

 

event ApplicationServerException: EventHandler<ApplicationServerExceptionEventArgs>

 

delegate EventHandler<ApplicationServerExceptionEventArgs> ApplicationServerException()

 

__event EventHandler<ApplicationServerExceptionEventArgs>: ApplicationServerException!

 

Event ApplicationServerException As EventHandler<ApplicationServerExceptionEventArgs>

AutoCreateSelfSignedCertificate

 

property AutoCreateSelfSignedCertificate: Boolean read write;

 

Boolean AutoCreateSelfSignedCertificate { get; set; }

 

var AutoCreateSelfSignedCertificate: Boolean { get{} set{} }

 

Property AutoCreateSelfSignedCertificate() As Boolean

CertificateGenerating

 

event CertificateGenerating: EventHandler<CertificateGeneratingEventArgs>

 

delegate EventHandler<CertificateGeneratingEventArgs> CertificateGenerating()

 

__event EventHandler<CertificateGeneratingEventArgs>: CertificateGenerating!

 

Event CertificateGenerating As EventHandler<CertificateGeneratingEventArgs>

ConsoleServerFooter  protected

 

property ConsoleServerFooter: String read;

 

String ConsoleServerFooter { get; }

 

var ConsoleServerFooter: String { get{} }

 

ReadOnly Property ConsoleServerFooter() As String

CreateNetworkServer  protected

 

method CreateNetworkServer(configuration: INetworkServerConfiguration): INetworkServer

 

INetworkServer CreateNetworkServer(INetworkServerConfiguration configuration)

 

func CreateNetworkServer(_ configuration: INetworkServerConfiguration) -> INetworkServer

 

Function CreateNetworkServer(configuration As INetworkServerConfiguration) As INetworkServer

Parameters:

  • configuration:

CreateServerMainForm  protected .NET Framework

 

method CreateServerMainForm: Form

 

Form CreateServerMainForm()

 

func CreateServerMainForm() -> Form

 

Function CreateServerMainForm() As Form

CreateServerWinService  protected .NET Framework

 

method CreateServerWinService: ServiceBase

 

ServiceBase CreateServerWinService()

 

func CreateServerWinService() -> ServiceBase

 

Function CreateServerWinService() As ServiceBase

DependencyResolver

 

property DependencyResolver: IDependencyContainer read write;

 

IDependencyContainer DependencyResolver { get; set; }

 

var DependencyResolver: IDependencyContainer { get{} set{} }

 

Property DependencyResolver() As IDependencyContainer

ExtendedParameters  protected

Gets or sets extended (ie unrecognized) parameters returned by the IArgumentParser instance.

Usually these are parameters that cannot be processed by the IArgumentParser instance being used.

In most cases it is enough to override the ProcessExtendedParameters to handle advanced command-line options.

 

property ExtendedParameters: array of String read;

 

String[] ExtendedParameters { get; }

 

var ExtendedParameters: String... { get{} }

 

ReadOnly Property ExtendedParameters() As String()

ExtendedParametersDescription  protected

 

property ExtendedParametersDescription: String read;

 

String ExtendedParametersDescription { get; }

 

var ExtendedParametersDescription: String { get{} }

 

ReadOnly Property ExtendedParametersDescription() As String

GetArgumentParser  protected

Returns a default implementation of the IArgumentParser.

If you need more profound logic of handling command-line arguments then you need to create your own implementation of the IArgumentParser interface. In that case you should override current method to make it return the instance of your custom parser.

 

method GetArgumentParser: IArgumentParser

 

IArgumentParser GetArgumentParser()

 

func GetArgumentParser() -> IArgumentParser

 

Function GetArgumentParser() As IArgumentParser

GetSelfSignedCertificate  protected

 

method GetSelfSignedCertificate: X509Certificate2

 

X509Certificate2 GetSelfSignedCertificate()

 

func GetSelfSignedCertificate() -> X509Certificate2

 

Function GetSelfSignedCertificate() As X509Certificate2

GetStartupOptionsHelpText  protected

Returns help string message.

By default this message contains description of common parameters and content of properties ApplicationInfo, HelpTextFooter, ExtendedParametersHelpText.

This method can be overriden to return custom help text.

 

method GetStartupOptionsHelpText: String

 

String GetStartupOptionsHelpText()

 

func GetStartupOptionsHelpText() -> String

 

Function GetStartupOptionsHelpText() As String

HelpTextFooter  protected

Gets the footer of help message. For example for the Relativity server this property returns Please visit http://wiki.remobjects.com/wiki/Relativity to get more information.

The default value of this property is an empty string.

 

property HelpTextFooter: String read;

 

String HelpTextFooter { get; }

 

var HelpTextFooter: String { get{} }

 

ReadOnly Property HelpTextFooter() As String

Identifier  protected

Gets applications unique identifier. This identifier is used to perform single-instance check during application startup.

This is abstract property so it should be overriden.

 

property Identifier: String read;

 

String Identifier { get; }

 

var Identifier: String { get{} }

 

ReadOnly Property Identifier() As String

Instance

The ApplicationServer class is a singleton. This property is used to access the current ApplicationServer class instance.

 

class property Instance: ApplicationServer read;

 

class ApplicationServer Instance { get; }

 

static var Instance: ApplicationServer { get{} }

 

Shared ReadOnly Property Instance() As ApplicationServer

IsAnotherInstanceDetected  protected

Gets or sets a flag indicating whether another rinning application instance has been detected.

 

property IsAnotherInstanceDetected: Boolean read;

 

Boolean IsAnotherInstanceDetected { get; }

 

var IsAnotherInstanceDetected: Boolean { get{} }

 

ReadOnly Property IsAnotherInstanceDetected() As Boolean

IsCheckForOtherInstancesRequired

Gets a flag indicating whether single-instance check should be performed on application startup.

The default value of this property is true.

 

property IsCheckForOtherInstancesRequired: Boolean read write;

 

Boolean IsCheckForOtherInstancesRequired { get; set; }

 

var IsCheckForOtherInstancesRequired: Boolean { get{} set{} }

 

Property IsCheckForOtherInstancesRequired() As Boolean

IsDebugEnabled  protected

Gets or sets flag indicating whether the Debug mode is active.

In the Debug mode the application will output extended information about unhandled exception (including stacktraces).

 

property IsDebugEnabled: Boolean read write;

 

Boolean IsDebugEnabled { get; set; }

 

var IsDebugEnabled: Boolean { get{} set{} }

 

Property IsDebugEnabled() As Boolean

IsQuietModeEnabled  protected

Gets or sets flag indicating whether quiet run mode was requested.

Quiet mode suppresses all output from service installation installation/deinstallation calls and is very useful if it is needed to register an application as Windows Service during application setup.

 

property IsQuietModeEnabled: Boolean read write;

 

Boolean IsQuietModeEnabled { get; set; }

 

var IsQuietModeEnabled: Boolean { get{} set{} }

 

Property IsQuietModeEnabled() As Boolean

IsWindowsPlatform  protected

 

class property IsWindowsPlatform: Boolean read;

 

class Boolean IsWindowsPlatform { get; }

 

static var IsWindowsPlatform: Boolean { get{} }

 

Shared ReadOnly Property IsWindowsPlatform() As Boolean

LoadApplicationServerConfiguration  protected

 

method LoadApplicationServerConfiguration

 

void LoadApplicationServerConfiguration()

 

func LoadApplicationServerConfiguration()

 

Sub LoadApplicationServerConfiguration()

NetworkServer

Gets the network server instance.

 

property NetworkServer: INetworkServer read;

 

INetworkServer NetworkServer { get; }

 

var NetworkServer: INetworkServer { get{} }

 

ReadOnly Property NetworkServer() As INetworkServer

NetworkServerConfiguration

 

property NetworkServerConfiguration: INetworkServerConfiguration read write;

 

INetworkServerConfiguration NetworkServerConfiguration { get; set; }

 

var NetworkServerConfiguration: INetworkServerConfiguration { get{} set{} }

 

Property NetworkServerConfiguration() As INetworkServerConfiguration

OnApplicationServerException  protected

 

method OnApplicationServerException(e: ApplicationServerExceptionEventArgs)

 

void OnApplicationServerException(ApplicationServerExceptionEventArgs e)

 

func OnApplicationServerException(_ e: ApplicationServerExceptionEventArgs)

 

Sub OnApplicationServerException(e As ApplicationServerExceptionEventArgs)

Parameters:

  • e:

OnCertificateGenerating  protected

 

method OnCertificateGenerating(e: CertificateGeneratingEventArgs)

 

void OnCertificateGenerating(CertificateGeneratingEventArgs e)

 

func OnCertificateGenerating(_ e: CertificateGeneratingEventArgs)

 

Sub OnCertificateGenerating(e As CertificateGeneratingEventArgs)

Parameters:

  • e:

OnStarting  protected

 

method OnStarting

 

void OnStarting()

 

func OnStarting()

 

Sub OnStarting()

OnStopped  protected

 

method OnStopped

 

void OnStopped()

 

func OnStopped()

 

Sub OnStopped()

ProcessExtendedParameters  protected

If the IArgumentParser encounters command-line parameters it cannot process then this method is called.

By default this method forces application sartup code to show correct command-line options help and to exit.

Override this method to handle custom command-line parameters.

``` protected override void ProcessExtendedParameters() { if (this.ExtendedParameters[0] == "--sample") { // Application-specific actions needed to handle the --sample startup parameter } } </source >

 

method ProcessExtendedParameters

 

void ProcessExtendedParameters()

 

func ProcessExtendedParameters()

 

Sub ProcessExtendedParameters()

RodlNamespace  protected

 

property RodlNamespace: String read write;

 

String RodlNamespace { get; set; }

 

var RodlNamespace: String { get{} set{} }

 

Property RodlNamespace() As String

Run

The main application startup entry point.

This method accepts command-line arguments, processes them and starts the application in appropriate mode.

 

method Run(arguments: array of String)

 

void Run(String[] arguments)

 

func Run(_ arguments: String...)

 

Sub Run(arguments As String())

Parameters:

  • arguments: Startup parameters.

RunAction

Gets current application run mode. See the ApplicationRunAction enumeration description for more details.

 

property RunAction: ApplicationRunAction read;

 

ApplicationRunAction RunAction { get; }

 

var RunAction: ApplicationRunAction { get{} }

 

ReadOnly Property RunAction() As ApplicationRunAction

RunAsConsoleApplication  protected

This method is called when command-line application run mode is requested.

This method should perform application startup procedures, f.e. initialize network and database connections etc.

 

method RunAsConsoleApplication

 

void RunAsConsoleApplication()

 

func RunAsConsoleApplication()

 

Sub RunAsConsoleApplication()

RunAsWindowsApplication  protected

This method is called when GUI-enabled application run mode is requested.

This method should perform application startup procedures, f.e. initialize network and database connections etc and show the main application form, either WinForms, GTK or WPF.

 

method RunAsWindowsApplication

 

void RunAsWindowsApplication()

 

func RunAsWindowsApplication()

 

Sub RunAsWindowsApplication()

RunAsWindowsService  protected

This method is called when application should be started as Windows Service.

This method should perform application startup procedures, f.e. initialize network and database connections etc.

 

method RunAsWindowsService

 

void RunAsWindowsService()

 

func RunAsWindowsService()

 

Sub RunAsWindowsService()

RunAsWindowsServiceInstaller  protected

 

method RunAsWindowsServiceInstaller

 

void RunAsWindowsServiceInstaller()

 

func RunAsWindowsServiceInstaller()

 

Sub RunAsWindowsServiceInstaller()

RunAsWindowsServiceUninstaller  protected

 

method RunAsWindowsServiceUninstaller

 

void RunAsWindowsServiceUninstaller()

 

func RunAsWindowsServiceUninstaller()

 

Sub RunAsWindowsServiceUninstaller()

RunUntil

 

method RunUntil(callback: Action)

 

void RunUntil(Action callback)

 

func RunUntil(_ callback: Action)

 

Sub RunUntil(callback As Action)

Parameters:

  • callback:

ServiceName  protected

Gets the sthort application name that will be used as Windows Service name.

This is abstract property so it should be overriden.

 

property ServiceName: String read;

 

String ServiceName { get; }

 

var ServiceName: String { get{} }

 

ReadOnly Property ServiceName() As String

ShutdownAsConsoleApplication  protected

This method is called when an application running in console mode is shut down.

Override this method to perform application shutdown procedures, f.e. closie network connections, release resources etc.

 

method ShutdownAsConsoleApplication

 

void ShutdownAsConsoleApplication()

 

func ShutdownAsConsoleApplication()

 

Sub ShutdownAsConsoleApplication()

Starting

 

event Starting: EventHandler

 

delegate EventHandler Starting()

 

__event EventHandler: Starting!

 

Event Starting As EventHandler

Stopped

 

event Stopped: EventHandler

 

delegate EventHandler Stopped()

 

__event EventHandler: Stopped!

 

Event Stopped As EventHandler

 

ApplicationInfo  protected

Gets brief additional info (like copyrights etc) about the application.

This property is used by the help command output as well as in the console mode.

For example for the Relativity server this property returns Please visit http://wiki.remobjects.com/wiki/Relativity to get more information.

The default value of this property is an empty string.

 

property ApplicationInfo: String read;

 

String ApplicationInfo { get; }

 

var ApplicationInfo: String { get{} }

 

ReadOnly Property ApplicationInfo() As String

ApplicationName  protected

Gets full application name, for example RemObjects Data Abstract Relativity Server.

This is abstract property so it should be overriden.

 

property ApplicationName: String read;

 

String ApplicationName { get; }

 

var ApplicationName: String { get{} }

 

ReadOnly Property ApplicationName() As String

AutoCreateSelfSignedCertificate

 

property AutoCreateSelfSignedCertificate: Boolean read write;

 

Boolean AutoCreateSelfSignedCertificate { get; set; }

 

var AutoCreateSelfSignedCertificate: Boolean { get{} set{} }

 

Property AutoCreateSelfSignedCertificate() As Boolean

ConsoleServerFooter  protected

 

property ConsoleServerFooter: String read;

 

String ConsoleServerFooter { get; }

 

var ConsoleServerFooter: String { get{} }

 

ReadOnly Property ConsoleServerFooter() As String

DependencyResolver

 

property DependencyResolver: IDependencyContainer read write;

 

IDependencyContainer DependencyResolver { get; set; }

 

var DependencyResolver: IDependencyContainer { get{} set{} }

 

Property DependencyResolver() As IDependencyContainer

ExtendedParameters  protected

Gets or sets extended (ie unrecognized) parameters returned by the IArgumentParser instance.

Usually these are parameters that cannot be processed by the IArgumentParser instance being used.

In most cases it is enough to override the ProcessExtendedParameters to handle advanced command-line options.

 

property ExtendedParameters: array of String read;

 

String[] ExtendedParameters { get; }

 

var ExtendedParameters: String... { get{} }

 

ReadOnly Property ExtendedParameters() As String()

ExtendedParametersDescription  protected

 

property ExtendedParametersDescription: String read;

 

String ExtendedParametersDescription { get; }

 

var ExtendedParametersDescription: String { get{} }

 

ReadOnly Property ExtendedParametersDescription() As String

HelpTextFooter  protected

Gets the footer of help message. For example for the Relativity server this property returns Please visit http://wiki.remobjects.com/wiki/Relativity to get more information.

The default value of this property is an empty string.

 

property HelpTextFooter: String read;

 

String HelpTextFooter { get; }

 

var HelpTextFooter: String { get{} }

 

ReadOnly Property HelpTextFooter() As String

Identifier  protected

Gets applications unique identifier. This identifier is used to perform single-instance check during application startup.

This is abstract property so it should be overriden.

 

property Identifier: String read;

 

String Identifier { get; }

 

var Identifier: String { get{} }

 

ReadOnly Property Identifier() As String

IsAnotherInstanceDetected  protected

Gets or sets a flag indicating whether another rinning application instance has been detected.

 

property IsAnotherInstanceDetected: Boolean read;

 

Boolean IsAnotherInstanceDetected { get; }

 

var IsAnotherInstanceDetected: Boolean { get{} }

 

ReadOnly Property IsAnotherInstanceDetected() As Boolean

IsCheckForOtherInstancesRequired

Gets a flag indicating whether single-instance check should be performed on application startup.

The default value of this property is true.

 

property IsCheckForOtherInstancesRequired: Boolean read write;

 

Boolean IsCheckForOtherInstancesRequired { get; set; }

 

var IsCheckForOtherInstancesRequired: Boolean { get{} set{} }

 

Property IsCheckForOtherInstancesRequired() As Boolean

IsDebugEnabled  protected

Gets or sets flag indicating whether the Debug mode is active.

In the Debug mode the application will output extended information about unhandled exception (including stacktraces).

 

property IsDebugEnabled: Boolean read write;

 

Boolean IsDebugEnabled { get; set; }

 

var IsDebugEnabled: Boolean { get{} set{} }

 

Property IsDebugEnabled() As Boolean

IsQuietModeEnabled  protected

Gets or sets flag indicating whether quiet run mode was requested.

Quiet mode suppresses all output from service installation installation/deinstallation calls and is very useful if it is needed to register an application as Windows Service during application setup.

 

property IsQuietModeEnabled: Boolean read write;

 

Boolean IsQuietModeEnabled { get; set; }

 

var IsQuietModeEnabled: Boolean { get{} set{} }

 

Property IsQuietModeEnabled() As Boolean

NetworkServer

Gets the network server instance.

 

property NetworkServer: INetworkServer read;

 

INetworkServer NetworkServer { get; }

 

var NetworkServer: INetworkServer { get{} }

 

ReadOnly Property NetworkServer() As INetworkServer

NetworkServerConfiguration

 

property NetworkServerConfiguration: INetworkServerConfiguration read write;

 

INetworkServerConfiguration NetworkServerConfiguration { get; set; }

 

var NetworkServerConfiguration: INetworkServerConfiguration { get{} set{} }

 

Property NetworkServerConfiguration() As INetworkServerConfiguration

RodlNamespace  protected

 

property RodlNamespace: String read write;

 

String RodlNamespace { get; set; }

 

var RodlNamespace: String { get{} set{} }

 

Property RodlNamespace() As String

RunAction

Gets current application run mode. See the ApplicationRunAction enumeration description for more details.

 

property RunAction: ApplicationRunAction read;

 

ApplicationRunAction RunAction { get; }

 

var RunAction: ApplicationRunAction { get{} }

 

ReadOnly Property RunAction() As ApplicationRunAction

ServiceName  protected

Gets the sthort application name that will be used as Windows Service name.

This is abstract property so it should be overriden.

 

property ServiceName: String read;

 

String ServiceName { get; }

 

var ServiceName: String { get{} }

 

ReadOnly Property ServiceName() As String

Instance

The ApplicationServer class is a singleton. This property is used to access the current ApplicationServer class instance.

 

class property Instance: ApplicationServer read;

 

class ApplicationServer Instance { get; }

 

static var Instance: ApplicationServer { get{} }

 

Shared ReadOnly Property Instance() As ApplicationServer

IsWindowsPlatform  protected

 

class property IsWindowsPlatform: Boolean read;

 

class Boolean IsWindowsPlatform { get; }

 

static var IsWindowsPlatform: Boolean { get{} }

 

Shared ReadOnly Property IsWindowsPlatform() As Boolean

 

constructor  protected

Creates a new instance of the ApplicationServer class.

This constructor can be called only from an inherited class.

 

constructor

 

ApplicationServer()

 

init()

 

Sub New()

constructor (String, String, String, String, array of Type)

 

constructor(applicationName: String; rodlNamespace: String; serviceName: String; serviceDescription: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, String rodlNamespace, String serviceName, String serviceDescription, params Type[] serviceTypes)

 

init(_ applicationName: String, _ rodlNamespace: String, _ serviceName: String, _ serviceDescription: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, rodlNamespace As String, serviceName As String, serviceDescription As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • rodlNamespace:
  • serviceName:
  • serviceDescription:
  • serviceTypes:

constructor (String, String, array of Type)

 

constructor(applicationName: String; rodlNamespace: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, String rodlNamespace, params Type[] serviceTypes)

 

init(_ applicationName: String, _ rodlNamespace: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, rodlNamespace As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • rodlNamespace:
  • serviceTypes:

constructor (String, array of Type)

 

constructor(applicationName: String; params serviceTypes: array of Type)

 

ApplicationServer(String applicationName, params Type[] serviceTypes)

 

init(_ applicationName: String, _ serviceTypes: Type...)

 

Sub New(applicationName As String, ParamArray serviceTypes As Type())

Parameters:

  • applicationName:
  • serviceTypes:

CreateNetworkServer  protected

 

method CreateNetworkServer(configuration: INetworkServerConfiguration): INetworkServer

 

INetworkServer CreateNetworkServer(INetworkServerConfiguration configuration)

 

func CreateNetworkServer(_ configuration: INetworkServerConfiguration) -> INetworkServer

 

Function CreateNetworkServer(configuration As INetworkServerConfiguration) As INetworkServer

Parameters:

  • configuration:

CreateServerMainForm  protected .NET Framework

 

method CreateServerMainForm: Form

 

Form CreateServerMainForm()

 

func CreateServerMainForm() -> Form

 

Function CreateServerMainForm() As Form

CreateServerWinService  protected .NET Framework

 

method CreateServerWinService: ServiceBase

 

ServiceBase CreateServerWinService()

 

func CreateServerWinService() -> ServiceBase

 

Function CreateServerWinService() As ServiceBase

GetArgumentParser  protected

Returns a default implementation of the IArgumentParser.

If you need more profound logic of handling command-line arguments then you need to create your own implementation of the IArgumentParser interface. In that case you should override current method to make it return the instance of your custom parser.

 

method GetArgumentParser: IArgumentParser

 

IArgumentParser GetArgumentParser()

 

func GetArgumentParser() -> IArgumentParser

 

Function GetArgumentParser() As IArgumentParser

GetSelfSignedCertificate  protected

 

method GetSelfSignedCertificate: X509Certificate2

 

X509Certificate2 GetSelfSignedCertificate()

 

func GetSelfSignedCertificate() -> X509Certificate2

 

Function GetSelfSignedCertificate() As X509Certificate2

GetStartupOptionsHelpText  protected

Returns help string message.

By default this message contains description of common parameters and content of properties ApplicationInfo, HelpTextFooter, ExtendedParametersHelpText.

This method can be overriden to return custom help text.

 

method GetStartupOptionsHelpText: String

 

String GetStartupOptionsHelpText()

 

func GetStartupOptionsHelpText() -> String

 

Function GetStartupOptionsHelpText() As String

LoadApplicationServerConfiguration  protected

 

method LoadApplicationServerConfiguration

 

void LoadApplicationServerConfiguration()

 

func LoadApplicationServerConfiguration()

 

Sub LoadApplicationServerConfiguration()

OnApplicationServerException  protected

 

method OnApplicationServerException(e: ApplicationServerExceptionEventArgs)

 

void OnApplicationServerException(ApplicationServerExceptionEventArgs e)

 

func OnApplicationServerException(_ e: ApplicationServerExceptionEventArgs)

 

Sub OnApplicationServerException(e As ApplicationServerExceptionEventArgs)

Parameters:

  • e:

OnCertificateGenerating  protected

 

method OnCertificateGenerating(e: CertificateGeneratingEventArgs)

 

void OnCertificateGenerating(CertificateGeneratingEventArgs e)

 

func OnCertificateGenerating(_ e: CertificateGeneratingEventArgs)

 

Sub OnCertificateGenerating(e As CertificateGeneratingEventArgs)

Parameters:

  • e:

OnStarting  protected

 

method OnStarting

 

void OnStarting()

 

func OnStarting()

 

Sub OnStarting()

OnStopped  protected

 

method OnStopped

 

void OnStopped()

 

func OnStopped()

 

Sub OnStopped()

ProcessExtendedParameters  protected

If the IArgumentParser encounters command-line parameters it cannot process then this method is called.

By default this method forces application sartup code to show correct command-line options help and to exit.

Override this method to handle custom command-line parameters.

``` protected override void ProcessExtendedParameters() { if (this.ExtendedParameters[0] == "--sample") { // Application-specific actions needed to handle the --sample startup parameter } } </source >

 

method ProcessExtendedParameters

 

void ProcessExtendedParameters()

 

func ProcessExtendedParameters()

 

Sub ProcessExtendedParameters()

Run

The main application startup entry point.

This method accepts command-line arguments, processes them and starts the application in appropriate mode.

 

method Run(arguments: array of String)

 

void Run(String[] arguments)

 

func Run(_ arguments: String...)

 

Sub Run(arguments As String())

Parameters:

  • arguments: Startup parameters.

RunAsConsoleApplication  protected

This method is called when command-line application run mode is requested.

This method should perform application startup procedures, f.e. initialize network and database connections etc.

 

method RunAsConsoleApplication

 

void RunAsConsoleApplication()

 

func RunAsConsoleApplication()

 

Sub RunAsConsoleApplication()

RunAsWindowsApplication  protected

This method is called when GUI-enabled application run mode is requested.

This method should perform application startup procedures, f.e. initialize network and database connections etc and show the main application form, either WinForms, GTK or WPF.

 

method RunAsWindowsApplication

 

void RunAsWindowsApplication()

 

func RunAsWindowsApplication()

 

Sub RunAsWindowsApplication()

RunAsWindowsService  protected

This method is called when application should be started as Windows Service.

This method should perform application startup procedures, f.e. initialize network and database connections etc.

 

method RunAsWindowsService

 

void RunAsWindowsService()

 

func RunAsWindowsService()

 

Sub RunAsWindowsService()

RunAsWindowsServiceInstaller  protected

 

method RunAsWindowsServiceInstaller

 

void RunAsWindowsServiceInstaller()

 

func RunAsWindowsServiceInstaller()

 

Sub RunAsWindowsServiceInstaller()

RunAsWindowsServiceUninstaller  protected

 

method RunAsWindowsServiceUninstaller

 

void RunAsWindowsServiceUninstaller()

 

func RunAsWindowsServiceUninstaller()

 

Sub RunAsWindowsServiceUninstaller()

RunUntil

 

method RunUntil(callback: Action)

 

void RunUntil(Action callback)

 

func RunUntil(_ callback: Action)

 

Sub RunUntil(callback As Action)

Parameters:

  • callback:

ShutdownAsConsoleApplication  protected

This method is called when an application running in console mode is shut down.

Override this method to perform application shutdown procedures, f.e. closie network connections, release resources etc.

 

method ShutdownAsConsoleApplication

 

void ShutdownAsConsoleApplication()

 

func ShutdownAsConsoleApplication()

 

Sub ShutdownAsConsoleApplication()

 

ApplicationServerException

 

event ApplicationServerException: EventHandler<ApplicationServerExceptionEventArgs>

 

delegate EventHandler<ApplicationServerExceptionEventArgs> ApplicationServerException()

 

__event EventHandler<ApplicationServerExceptionEventArgs>: ApplicationServerException!

 

Event ApplicationServerException As EventHandler<ApplicationServerExceptionEventArgs>

CertificateGenerating

 

event CertificateGenerating: EventHandler<CertificateGeneratingEventArgs>

 

delegate EventHandler<CertificateGeneratingEventArgs> CertificateGenerating()

 

__event EventHandler<CertificateGeneratingEventArgs>: CertificateGenerating!

 

Event CertificateGenerating As EventHandler<CertificateGeneratingEventArgs>

Starting

 

event Starting: EventHandler

 

delegate EventHandler Starting()

 

__event EventHandler: Starting!

 

Event Starting As EventHandler

Stopped

 

event Stopped: EventHandler

 

delegate EventHandler Stopped()

 

__event EventHandler: Stopped!

 

Event Stopped As EventHandler