| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Quadarax.Foundation.Core.Data;
- using Quadarax.Foundation.Core.Logging;
- using Quadarax.Foundation.Core.Object;
- namespace qdr.fnd.core.pqueue.Process
- {
- public class PsProcessProviderBase : DisposableObject
- {
- protected ILog Log { get; private set; }
- public IDictionary<string, TypedArgument> Arguments { get; private set; }
- public bool IsRunning { get; private set; }
- public string ItemId { get; private set; }
- public PsProcessProviderBase(string itemId, TypedArgument[] arguments, ILogger logger)
- {
- if (string.IsNullOrEmpty(itemId)) throw new ArgumentNullException(nameof(itemId));
- ItemId = itemId;
- Log = logger.GetLogger(GetType());
- Arguments = arguments.ToDictionary(x => x.Name, x => x);
- }
- #region Overrides of DisposableObject
- /// <inheritdoc />
- protected override void OnDisposing()
- {
- throw new NotImplementedException();
- }
- #endregion
- #region Implementation of IPsProcessProvider
- /// <inheritdoc />
- public void Validate()
- {
- }
- /// <inheritdoc />
- public async Task Start()
- {
- Validate();
- try
- {
- await OnProcess();
- }
- catch (Exception e)
- {
- await OnProcessError(e);
- Log.Log(LogSeverityEnum.Error, "Provider running failed.", e);
- }
- }
- private async Task OnProcessError(Exception exception)
- {
- throw new NotImplementedException();
- }
- private async Task OnProcess()
- {
- throw new NotImplementedException();
- }
- /// <inheritdoc />
- public async void Stop()
- {
- throw new NotImplementedException();
- }
- #endregion
- }
- }
|