public void Init() { ServerKey = Guid.NewGuid().ToString(); clientManager = new ClientManager(); nodeManager = new NodeManager(); jobManager = new JobManager(clientManager, nodeManager); hbManager = new HeartbeatManager(OnClientUnreachable, OnNodeUnreachable); //postProcessor = new PostProcessor(jobManager, clientManager, nodeManager, lockObj); nodeManager.AddJobmanager(jobManager); try { IConnection connection = GlobalRabbitMQConnection.Instance.GetConnection(); connection.ConnectionShutdown += Connection_ConnectionShutdown; connection.ConnectionBlocked += Connection_ConnectionBlocked; connection.ConnectionUnblocked += Connection_ConnectionUnblocked; syncClientReceiver = new SyncMessageReceiver("DSDPS_SYNC", "CLIENT", "SERVER", SyncClientMessageProcessor); syncClientReceiver.Init(); syncNodeReceiver = new SyncMessageReceiver("DSDPS_SYNC", "NODE", "SERVER", SyncNodeMessageProcessor); syncNodeReceiver.Init(); syncUpdateReceiver = new SyncMessageReceiver("DSDPS_UPDATE", "NODE", "SERVER", SyncNodeUpdateMessageProcessor); syncUpdateReceiver.Init(true); Console.WriteLine("Node proc binary version : " + DPSServerSetting.Instance.LastNodeProcVersion); Console.WriteLine("Node version : " + DPSServerSetting.Instance.NodeVersion); } catch (Exception) { Console.WriteLine("[Error] Error occured while initializing server! \nPress any key to exit."); Console.Read(); Environment.Exit(1); } DPSServerSetting.Save(); }
/// <summary> /// Add jobmanager instance to node manager instance. /// </summary> /// <param name="jobManager"></param> public void AddJobmanager(JobManager jobManager) { this.jobManager = jobManager; }