def METHOD_NAME(self):
    if hasattr(self, "http_application"):
        for application in self.http_application.applications:
            if hasattr(application, "stop") and callable(application.stop):
                application.stop()
    for service in self.services.values():
        service.stop()