/// <summary>Initializes this deferred initializable object</summary>
        public void Initialize()
        {
            var           proxy   = client.CreateProxy <IIpcWinSvcWatchDog>(watchDogName);
            ServiceConfig Section = JsonSettingsSection.GetSection <ServiceConfig>("GenericService_ServiceConfiguration");

            if (Section.UseExtConfig)
            {
                var cp = Process.GetCurrentProcess();
                proxy.RegisterService(cp.MachineName, Section.ServiceName, cp.ProcessName, cp.Id);
            }
            else
            {
                LogEnvironment.LogEvent("Unable to register a service that is using xml-configuration", LogSeverity.Error);
            }

            Initialized = true;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes this deferred initializable object
 /// </summary>
 public void Initialize()
 {
     if (!Initialized)
     {
         remoteWatchDog = client.CreateProxy <IIpcWatchDog>(objectName);
         var proc = Process.GetCurrentProcess();
         processId   = proc.Id;
         processName = proc.ProcessName;
         machineName = proc.MachineName;
         remoteWatchDog.SetProcessStatus(machineName, processName, processId, false);
         Initialized = true;
     }
 }
Exemplo n.º 3
0
 public ProcessBridgeClient(IBaseClient simpleClient, string remoteLoggerName, LogSeverity minSeverity, LogSeverity maxSeverity, string contextFilter, bool initialStatus, bool debugEnabled)
     : base(minSeverity, maxSeverity, contextFilter, initialStatus, debugEnabled)
 {
     this.simpleClient = simpleClient;
     try
     {
         if (simpleClient.Operational)
         {
             loggerObject = simpleClient.CreateProxy <ILogBridge>(remoteLoggerName);
             active       = true;
         }
     }
     catch (Exception ex)
     {
         LogEnvironment.LogEvent($"Failed to initialize remote-logger ({remoteLoggerName}@{simpleClient.UniqueName}): {ex.Message}", LogSeverity.Error);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the ScheduleManagementClient class
 /// </summary>
 /// <param name="client">the base client that is used to communicate with the remote service</param>
 /// <param name="managementObjectName">the name of the management object</param>
 public ScheduleManagementClient(IBaseClient client, string managementObjectName)
 {
     this.client = client;
     this.managementObjectName = managementObjectName;
     proxy = client.CreateProxy <ISchedulingManager>(managementObjectName);
 }
 public DatabaseProxyClient(IBaseClient communicationObject, string serverProxyName)
 {
     proxy     = communicationObject.CreateProxy <IRemoteProxyDefinition>(serverProxyName);
     sessionId = proxy.AcquireConnection();
 }
 /// <summary>
 /// Initializes a new instance of the PluginManagementClient object
 /// </summary>
 /// <param name="communicator">the communicator object that is used to connect to the service process</param>
 /// <param name="managementObject">the name of the PluginManagementServer object</param>
 public PluginManagementClient(IBaseClient communicator, string managementObject)
 {
     this.communicator     = communicator;
     this.managementObject = managementObject;
     server = communicator.CreateProxy <IPluginManagementServer>(managementObject);
 }