Esempio n. 1
0
        public new void InitializeAgent(Illuminate.Contexts.AgentContext context)
        {
            _dataService = context.NodeDataService;

            base.InitializeAgent(context);

            _currentManagerNodeName = _context.NodeId;
            _context.NodeId = Illuminate.Communication.Communicator.MANAGERNAME;

            Logger.WriteLine("Getting AgentManagerInterval...", Logger.Severity.Debug, LOGNAME);
            int agentManagerInterval = 0;
            if (!int.TryParse(_dataService.Monitor.GetSetting(Illuminate.Node.Managers.Settings.AgentManagerInterval), out agentManagerInterval))
                throw new Illuminate.Exceptions.ErrorException("AgentManagerInterval either not defined or invalid.");
            _context.Interval = agentManagerInterval;
            Logger.WriteLine("AgentManagerInterval: " + _context.Interval.ToString() + "...", Logger.Severity.Debug, LOGNAME);

            Logger.WriteLine("Getting EnableLoadBalancing...", Logger.Severity.Debug, LOGNAME);
            _enableLoadBalancing = false;
            if (_dataService.Monitor.GetSetting(Illuminate.Node.Managers.Settings.EnableLoadBalancing) == "True")
            {
                _enableLoadBalancing = true;
                _loadBalancer = new LoadBalancer(context, LOGNAME);
            }
            else
            {
                Logger.WriteLine("LoadBalancing is disabled.", Logger.Severity.Information, LOGNAME);
            }
            Logger.WriteLine("EnableLoadBalancing: " + _enableLoadBalancing.ToString() + "...", Logger.Severity.Debug, LOGNAME);

            _context.Communicator.OnDataIn += new Illuminate.Communication.Communicator.OnDataInDelegate(com_OnDataIn);

            _dataService.Monitor.NotifyNewManagerStarted(_currentManagerNodeName);
        }
Esempio n. 2
0
        public NodeAgentManagement(Illuminate.Node.Service dataService, string logName)
        {
            _dataService = dataService;
            LOGNAME = logName;

            _nodeAgents = new Dictionary<string, Node.Collections.IAgent>();
            _nodeAgentTypeCount = new Dictionary<string, Dictionary<string, int>>();
            _agentNodes = new Dictionary<string, List<string>>();
            _nodeAgentsToAdd = new Dictionary<string, List<string>>();
            _nodeAgentsToRemove = new Dictionary<string, List<string>>();

            _minimumTotalAgentLimits = _dataService.Monitor.GetTotalAgentLimits("MIN");
            _maximumTotalAgentLimits = _dataService.Monitor.GetTotalAgentLimits("MAX");
            _minimumNodeAgentLimits = _dataService.Monitor.GetNodeAgentLimits("MIN");
            _maximumNodeAgentLimits = _dataService.Monitor.GetNodeAgentLimits("MAX");
        }
Esempio n. 3
0
 public DatabaseLogTarget()
 {
     _IS = new Illuminate.Node.Service();
 }