Esempio n. 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);
 }
Esempio n. 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;
 }
Esempio n. 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));
 }
Esempio n. 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));
 }
Esempio n. 5
0
 protected abstract TProcess DoGet <TProcess>(PID pid) where TProcess : Process;
Esempio n. 6
0
 protected abstract ProcessDescriptor DoGetDescriptor(PID pid);
Esempio n. 7
0
 public TProcess Get <TProcess>(PID pid) where TProcess : Process
 {
     return(DoGet <TProcess>(pid));
 }
Esempio n. 8
0
 public ProcessDescriptor GetDescriptor(PID pid)
 {
     return(DoGetDescriptor(pid));
 }
Esempio n. 9
0
 public ResultSignal Dispatch(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Dispatch(pid, args, SignalTypeResolver.Resolve(type)));
 }
Esempio n. 10
0
 public Task <ResultSignal> Async_Dispatch(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Async_Dispatch(pid, args, SignalTypeResolver.Resolve(type)));
 }
Esempio n. 11
0
 public Task Async_Spawn(PID pid, IConfigSectionNode args, Guid type)
 {
     return(Async_Spawn(pid, args, ProcessTypeResolver.Resolve(type)));
 }
Esempio n. 12
0
 public void Spawn(PID pid, IConfigSectionNode args, Guid type)
 {
     Spawn(pid, args, ProcessTypeResolver.Resolve(type));
 }
Esempio n. 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);
        }
Esempio n. 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);
Esempio n. 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);