/// <summary> /// Add the passed /// <see cref="Service"/> /// to the list of services managed by this /// <see cref="CompositeService"/> /// </summary> /// <param name="service"> /// the /// <see cref="Service"/> /// to be added /// </param> protected internal virtual void AddService(Org.Apache.Hadoop.Service.Service service ) { if (Log.IsDebugEnabled()) { Log.Debug("Adding service " + service.GetName()); } lock (serviceList) { serviceList.AddItem(service); } }
/// <summary>Stop a service; if it is null do nothing.</summary> /// <remarks> /// Stop a service; if it is null do nothing. Exceptions are caught and /// logged at warn level. (but not Throwables). This operation is intended to /// be used in cleanup operations /// </remarks> /// <param name="log">the log to warn at</param> /// <param name="service">a service; may be null</param> /// <returns>any exception that was caught; null if none was.</returns> /// <seealso cref="StopQuietly(Service)"/> public static Exception StopQuietly(Log log, Org.Apache.Hadoop.Service.Service service ) { try { Stop(service); } catch (Exception e) { log.Warn("When stopping the service " + service.GetName() + " : " + e, e); return(e); } return(null); }
public virtual void StateChanged(Org.Apache.Hadoop.Service.Service service) { lock (this) { eventCount++; lastService = service; lastState = service.GetServiceState(); stateEventList.AddItem(lastState); if (lastState == failingState) { failureCount++; throw new BreakableService.BrokenLifecycleEvent(service, "Failure entering " + lastState + " for " + service.GetName()); } } }
/// <summary>Callback for a state change event: log it</summary> /// <param name="service">the service that has changed.</param> public virtual void StateChanged(Org.Apache.Hadoop.Service.Service service) { log.Info("Entry to state " + service.GetServiceState() + " for " + service.GetName ()); }