@Override
    public void run() {

        if (!ignoreListenShutdownHook && destroyed.compareAndSet(false, true)) {
            if (logger.isInfoEnabled()) {
                logger.info("Run shutdown hook now.");
            }

            doDestroy();
        }
    }
@Test
    public void testDestoryWithModuleManagedExternally() throws InterruptedException {
        applicationModel.getModuleModels().get(0).setLifeCycleManagedExternally(true);
        new Thread(() -> {
                    applicationModel.getModuleModels().get(0).destroy();
                })
                .start();
        TimeUnit.MILLISECONDS.sleep(10);
        dubboShutdownHook.run();
        Assertions.assertTrue(applicationModel.isDestroyed());
    }