Beispiel #1
0
 public void CreateNode(NodeSettings options, string args)
 {
     var psi = new ProcessStartInfo(_nodeExePath, args)
     {
         CreateNoWindow = false
     };
     Process.Start(psi);
 }
Beispiel #2
0
 public NodeStatus(string name, NodeState state, int tasksCount, DateTime timestamp, string machineName, int processId, long memory, NodeSettings nodeSettings)
 {
     Name = name;
     State = state;
     TasksCount = tasksCount;
     Timestamp = timestamp;
     MachineName = machineName;
     ProcessId = processId;
     Memory = memory;
     NodeSettings = nodeSettings;
 }
Beispiel #3
0
        public static void RunNode(string[] args)
        {
            var settings = new NodeSettings();
            if (!CommandLine.Parser.Default.ParseArguments(args, settings))
            {
                Console.WriteLine(HelpText.AutoBuild(settings).ToString());
                return;
            }

            settings.DtoFromType = String.Format("MK.Import.Domain.Dto.Messaging.{0}, MK.Import.Domain", settings.DtoFromType);
            settings.DtoToType = String.Format("MK.Import.Domain.Dto.Messaging.{0}, MK.Import.Domain", settings.DtoToType);

            RunNode(settings);
        }
Beispiel #4
0
        public static void RunNode(NodeSettings settings)
        {
            var serviceType = GetTypeFromString(settings.ServiceName);
            var service = Activator.CreateInstance(serviceType, false);

            var dtoFromType = GetTypeFromString(settings.DtoFromType);
            var dtoToType = String.IsNullOrWhiteSpace(settings.DtoToType)
                ? dtoFromType
                : GetTypeFromString(settings.DtoToType);

            var template = typeof(ServiceNode<,>);
            var serviceNodeType = template.MakeGenericType(dtoFromType, dtoToType);

            using (var node = (IServiceNode)Activator.CreateInstance(serviceNodeType, service, settings))
            {
                node.Start();

                Console.ReadLine();
            }
        }
Beispiel #5
0
 public NodeStatus(string name, NodeState state, int tasksCount, NodeSettings nodeSettings)
     : this(name, state, tasksCount, DateTime.Now, Environment.MachineName, Process.GetCurrentProcess().Id, Process.GetCurrentProcess().PrivateMemorySize64, nodeSettings)
 {
 }