Exemple #1
0
 private static TSignal makeDefault <TSignal>(ISkyApplication app, TSignal signal, PID pid) where TSignal : Signal
 {
     app.DependencyInjector.InjectInto(signal);
     signal.m_SysID           = app.GdidProvider.GenerateOneGdid(SysConsts.GDID_NS_WORKER, SysConsts.GDID_NAME_WORKER_SIGNAL);
     signal.m_SysPID          = pid;
     signal.m_SysTimestampUTC = app.TimeSource.UTCNow;
     signal.m_SysAbout        = "{0}@{1}@{2}".Args(Ambient.CurrentCallUser.Name, app.Name, app.HostName);
     return(signal);
 }
Exemple #2
0
 public void ____Deserialize(GDID id, PID pid, DateTime ts, string about)
 {
     m_SysID = id; m_SysPID = pid; m_SysTimestampUTC = ts; m_SysAbout = about;
 }
Exemple #3
0
 /// <summary>
 /// Factory method that creates new Signal based on provided PID
 /// </summary>
 public static TSignal MakeNew <TSignal>(IApplication app, PID pid) where TSignal : Signal, new()
 {
     return(makeDefault(app.AsSky(), new TSignal(), pid));
 }
Exemple #4
0
 /// <summary>
 /// Factory method that creates new Signal based on provided Type, PID and Configuration
 /// </summary>
 public static Signal MakeNew(IApplication app, Type type, PID pid, IConfigSectionNode args)
 {
     return(makeDefault(app.AsSky(), FactoryUtils.MakeAndConfigure <Signal>(args, type), pid));
 }
Exemple #5
0
 protected abstract TProcess DoGet <TProcess>(PID pid) where TProcess : Process;
Exemple #6
0
 protected abstract ProcessDescriptor DoGetDescriptor(PID pid);
Exemple #7
0
 public TProcess Get <TProcess>(PID pid) where TProcess : Process
 {
     return(DoGet <TProcess>(pid));
 }
Exemple #8
0
 public ProcessDescriptor GetDescriptor(PID pid)
 {
     return(DoGetDescriptor(pid));
 }
Exemple #9
0
 public ResultSignal Dispatch(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Dispatch(pid, args, SignalTypeResolver.Resolve(type)));
 }
Exemple #10
0
 public Task <ResultSignal> Async_Dispatch(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Async_Dispatch(pid, args, SignalTypeResolver.Resolve(type)));
 }
Exemple #11
0
 public Task Async_Spawn(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Async_Spawn(pid, args, ProcessTypeResolver.Resolve(type)));
 }
Exemple #12
0
 public void Spawn(PID pid, IConfigSectionNode args, Guid type)
 {
     Spawn(pid, args, ProcessTypeResolver.Resolve(type));
 }
Exemple #13
0
        private static TProcess makeDefault <TProcess>(ISkyApplication app, TProcess process, PID pid) where TProcess : Process
        {
            app.DependencyInjector.InjectInto(process);

            var attr = GuidTypeAttribute.GetGuidTypeAttribute <Process, ProcessAttribute>(process.GetType());

            var descriptor = new ProcessDescriptor(
                pid,
                attr.Description,
                app.TimeSource.UTCNow,
                "{0}@{1}@{2}".Args(Ambient.CurrentCallUser.Name, app.Name, app.HostName));

            process.m_SysDescriptor = descriptor;
            return(process);
        }
Exemple #14
0
 /// <summary>
 /// Factory method that creates new Process based on provided Type, PID and Configuration
 /// </summary>
 public static Process MakeNew(IApplication app, Type type, PID pid, IConfigSectionNode args)
 => makeDefault(app.AsSky(), FactoryUtils.MakeAndConfigure <Process>(args, type), pid);
Exemple #15
0
 /// <summary>
 /// Factory method that creates new Process based on provided PID
 /// </summary>
 public static TProcess MakeNew <TProcess>(IApplication app, PID pid) where TProcess : Process, new()
 => makeDefault(app.AsSky(), new TProcess(), pid);