sustain/src/main/java/net/happyonroad/component/container/support/DefaultComponentLoader.java
@Override
    public void unload(Component component) {
        if (!isLoaded(component)) return;
        logger.debug("Before unloading {}", component);
        //先卸载自身
        quickUnload(component);
        //再卸载依赖
        for (Component depended : component.getDependedComponents()) {
            //上面会自动检测是否已经加载，防止重复加载
            unload(depended);
        }
        //最后卸载其父组件
        if (component.getParent() != null) {
            //上面会自动检测是否已经加载，防止重复加载
            unload(component.getParent());
        }
        logger.debug("After  unloaded  {}", component);
    }
@Override
    public void unload(Component component) {
        if (!isLoaded(component)) return;
        logger.debug("Before unloading {}", component);
        //先卸载自身
        quickUnload(component);
        //再卸载依赖
        for (Component depended : component.getDependedComponents()) {
            //上面会自动检测是否已经加载，防止重复加载
            unload(depended);
        }
        //最后卸载其父组件
        if (component.getParent() != null) {
            //上面会自动检测是否已经加载，防止重复加载
            unload(component.getParent());
        }
        logger.debug("After  unloaded  {}", component);
    }
@ Override public void unload ( Component component ) { if ( ! isLoaded ( component ) ) return ; logger . debug ( "Before unloading {}" , component ) ; //先卸载自身 quickUnload ( component ) ; //再卸载依赖 for ( Component depended : component . getDependedComponents ( ) ) { //上面会自动检测是否已经加载，防止重复加载 unload ( depended ) ; } //最后卸载其父组件 if ( component . getParent ( ) != null ) { //上面会自动检测是否已经加载，防止重复加载 unload ( component . getParent ( ) ) ; } logger . debug ( "After  unloaded  {}" , component ) ; }
剥洋葱一样的卸载组件

@param component 被卸载的组件
剥洋葱一样的卸载组件