Introduced a #shutdown method to support Windows Service stop