public void UpdateAgent(QMFObject obj) { long agentBank = (long)obj.GetProperty("agentBank"); long brokerBank = (long)obj.GetProperty("brokerBank"); String key = Agent.AgentKey(agentBank, brokerBank); if (obj.IsDeleted()) { if (Agents.ContainsKey(key)) { Agent agent = Agents[key]; Agents.Remove(key); consoleSession.HandleAgentRemoved(agent); } } else { if (!Agents.ContainsKey(key)) { Agent newAgent = new Agent(this, agentBank, (string)obj.GetProperty("label")); Agents.Add(key, newAgent); consoleSession.HandleNewAgent(newAgent); } } }
public void HandleContentIndicator(Broker broker, IDecoder decoder, long sequence, bool hasProperties, bool hasStatistics) { ClassKey key = new ClassKey(decoder); SchemaClass sClass = null;; lock (LockObject) { sClass = GetSchema(key, false); } if (sClass != null) { QMFObject obj = this.CreateQMFObject(sClass, decoder, hasProperties, hasStatistics, true); if (key.PackageName.Equals("org.apache.qpid.broker") && key.ClassName.Equals("agent") && hasProperties) { broker.UpdateAgent(obj); } lock (LockObject) { if (SyncSequenceList.Contains(sequence)) { if (!obj.IsDeleted() && this.SelectMatch(obj)) { GetResult.Add(obj); } } } if (Console != null) { if (hasProperties) { Console.ObjectProperties(broker, obj); } if (hasStatistics) { Console.ObjectStatistics(broker, obj); } } } }
public void UpdateAgent(QMFObject obj) { long agentBank = (long)obj.GetProperty("agentBank") ; long brokerBank = (long)obj.GetProperty("brokerBank") ; String key = Agent.AgentKey(agentBank, brokerBank) ; if (obj.IsDeleted()) { if (Agents.ContainsKey(key)) { Agent agent = Agents[key] ; Agents.Remove(key) ; consoleSession.HandleAgentRemoved(agent) ; } } else { if (! Agents.ContainsKey(key)) { Agent newAgent = new Agent(this, agentBank, (string)obj.GetProperty("label")) ; Agents.Add(key, newAgent) ; consoleSession.HandleNewAgent(newAgent) ; } } }