Service Hoster

A Service to host TimeLine sub-services

The TimeLine Service Hoster is an independent Windows service which is able to host sub-services which can easily interact with the TimeLine ecosystem. Please note that the term sub-service is used very loosely and is not an actual service, it rather is an AppDomain running in the Service Hoster service. The services are started inside a headless TimeLine client. The client also performs a login to provide access to all non visual TimeLine features like xTransactions, BusinessObjects and the Sql class.

Configuring the Service Hoster

The Service Hoster loads a config called services.json from the TimeLine servers config directory. To edit it the visual editor inside the TimeLine Server app can be used. To access it right click on the TimeLine Service Hoster and choose Config.

Example config

The service name must be unique. The assembly must not contain a path. It must just be the assembly name including the file ending. The class must be the assembly qualified name of the type (full namespace plus class name). Root path and custom path are optional overrides for the service. The mandants for which the service will be started for can be configured using one of the edit mandants buttons.

Example mandants

It is advised to create a new user to run the service. The service will create a session and block the user but it will not use a workplace license.

The assembly is resolved using the ObjectFactory. The default root is [TimeLine server installation root]\ServicesRoot. The custom path is set in the TLX.ini for each mandant. These paths can be overridden for each service using the Root path and Custom path properties.

Logging

The Service Hoster has its own log file which is located in [TimeLine server installation root]\Logs\ServiceHoster. Each hosted service has its own sub directory containing the services log files.

Creating a custom service

Add a reference to TimeLine.Services.Framework to the project that will contain the service. The service class must inherit from TimeLine.Services.Framework.TlService.

The TlService class contains the property Log which should be used to log any information needed to the services log file. It also has 3 abstract methods which must be implemented.

When the service starts the Init() method is the first method that is called. Afterwards the login is performed. After a successful login the Start() method is called. When the service stops the Stop() method is called.

Debugging issues with the service hoster

You can check the log files associated with the service hoster and hosted services to find more information about potential issues. These log files are located in the TLServer\Logs\ServiceHoster directory.

Last updated