private void unregisterApp(FinalApplicationStatus finalStatus, String diagnostics) {
        for (int retry = 30; retry > 0; ++retry) {
            if (applicationMessageQueue.isEmpty()) {
                break;
            }
            Utilities.sleep(1 * 1000);
        }
        if (!applicationMessageQueue.isEmpty()) {
            LOG.error("applicationMessageQueue is not drained");
        }

        try {
            amrmAsync.unregisterApplicationMaster(finalStatus, diagnostics, applicationHistoryUrl);
            amrmAsync.stop();
        } catch (Exception e) {
            LOG.error("Error while unregistering Application", e);
        }
    }
Async Method telling NMClientAsync to launch specific container

@param container the container which should be launched
@return is launched success
core/src/main/java/net/qihoo/hbox/AM/ApplicationMaster.java