protected void WaitForAgent(ref Session session, DelegateWithSession methodInvoker) { Host host = TryResolveWithTimeout(this.Host); _WaitForReboot(host.IsMaster(), ref session, GetAgentStartTime, methodInvoker); }
private void _WaitForReboot(bool master, ref Session session, MetricDelegate metricDelegate, DelegateWithSession methodInvoker) { _cancelled = false; double metric = metricDelegate(session); log.DebugFormat("{0}._WaitForReboot(master='{1}', metric='{2}')", GetType().Name, master, metric); PercentComplete = 10; RegisterConnectionLostEvent(); try { methodInvoker(session); PercentComplete = 20; log.DebugFormat("{0}._WaitForReboot executed delegate...", GetType().Name); session = WaitForHostToStart(master, session, metricDelegate, metric); } finally { DeregisterConnectionLostEvent(); } }