51 lines
1.9 KiB
VB.net
51 lines
1.9 KiB
VB.net
Imports Quartz
|
|
Imports Quartz.Impl
|
|
Imports Quartz.Logging
|
|
Imports DigitalData.Modules.Database
|
|
Imports System.Collections.Specialized
|
|
Imports DigitalData.Modules.Logging
|
|
Imports DigitalData.Modules.Logging.LogConfig
|
|
Imports System.IO
|
|
Imports DigitalData.Modules.Config
|
|
|
|
Public Class MyTCService
|
|
Private _firebird As Firebird
|
|
Private _logConfig As LogConfig
|
|
Private _logger As DigitalData.Modules.Logging.Logger
|
|
|
|
Private _Props As New NameValueCollection From {
|
|
{"quartz.serializer.type", "binary"},
|
|
{"quartz.threadPool.threadCount", 10}
|
|
}
|
|
Private _factory As StdSchedulerFactory
|
|
Private _scheduler As IScheduler
|
|
|
|
Private _config As ConfigManager(Of clsConfig)
|
|
Protected Overrides Sub OnStart(ByVal args() As String)
|
|
Try
|
|
' Code zum Starten des Dienstes hier einfügen. Diese Methode sollte Vorgänge
|
|
' ausführen, damit der Dienst gestartet werden kann.
|
|
_logConfig = New LogConfig(PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"), Nothing, "Digital Data", "TCService") With {
|
|
.Debug = My.Settings.LOG_DEBUG
|
|
}
|
|
_logger.Info("Starting Service {0}", ServiceName)
|
|
_config = New ConfigManager(Of clsConfig)(_logConfig, My.Application.Info.DirectoryPath)
|
|
|
|
_firebird = New Firebird(_logConfig, _config.Config.Firebird.DataSource, _config.Config.Firebird.Database, _config.Config.Firebird.User, _config.Config.Firebird.Password)
|
|
If _firebird._DBInitialized = False Then
|
|
_logger.Info("FIREBIRD NOT INTITIALIZED!!")
|
|
End If
|
|
Catch ex As Exception
|
|
|
|
End Try
|
|
|
|
End Sub
|
|
|
|
Protected Overrides Sub OnStop()
|
|
' Hier Code zum Ausführen erforderlicher Löschvorgänge zum Beenden des Dienstes einfügen.
|
|
_logger.Info("Stopping Service {0}", ServiceName)
|
|
|
|
End Sub
|
|
|
|
End Class
|