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