src/aria/templates/ModuleCtrlFactory.js
function (moduleCtrlPrivate, cb) {
                var res = getModulePrivateInfoWithCheck(moduleCtrlPrivate, "reloadModuleCtrl");
                if (!res) {
                    // error is already logged
                    return;
                }
                var subModuleInfos = res.subModuleInfos;
                if (subModuleInfos == null) {
                    this.$logError(this.RELOAD_ONLY_FOR_SUBMODULES, [moduleCtrlPrivate.$classpath]);
                    return;
                }
                var parentModule = subModuleInfos.parentModule;
                this.$assert(668, parentModule != null);

                var oldModuleCtrl = res.moduleCtrl;
                var oldFlowCtrl = res.flowCtrl;
                var classMgr = ariaCoreClassMgr;
                var toBeUnloaded = [moduleCtrlPrivate.$classpath, moduleCtrlPrivate.$publicInterfaceName];
                var flowCtrlPrivate = res.flowCtrlPrivate;
                if (flowCtrlPrivate) {
                    toBeUnloaded[2] = flowCtrlPrivate.$classpath;
                    toBeUnloaded[3] = flowCtrlPrivate.$publicInterfaceName;
                }
                var objectLoading = new ariaTemplatesObjectLoading();
                moduleCtrlPrivate.__$reloadingObject = objectLoading;
                moduleCtrlPrivate.$dispose();
                for (var i = 0, l = toBeUnloaded.length; i < l; i++) {
                    classMgr.unloadClass(toBeUnloaded[i], true);
                }
                loadSubModules.call(this, parentModule, [subModuleInfos.subModuleDesc], {
                    fn : reloadModuleCtrlCb,
                    scope : this,
                    args : {
                        objectLoading : objectLoading,
                        oldModuleCtrl : oldModuleCtrl,
                        oldFlowCtrl : oldFlowCtrl,
                        callback : cb
                    }
                }, subModuleInfos.customModule);
            }
function (moduleCtrlPrivate, cb) {
                var res = getModulePrivateInfoWithCheck(moduleCtrlPrivate, "reloadModuleCtrl");
                if (!res) {
                    // error is already logged
                    return;
                }
                var subModuleInfos = res.subModuleInfos;
                if (subModuleInfos == null) {
                    this.$logError(this.RELOAD_ONLY_FOR_SUBMODULES, [moduleCtrlPrivate.$classpath]);
                    return;
                }
                var parentModule = subModuleInfos.parentModule;
                this.$assert(668, parentModule != null);

                var oldModuleCtrl = res.moduleCtrl;
                var oldFlowCtrl = res.flowCtrl;
                var classMgr = ariaCoreClassMgr;
                var toBeUnloaded = [moduleCtrlPrivate.$classpath, moduleCtrlPrivate.$publicInterfaceName];
                var flowCtrlPrivate = res.flowCtrlPrivate;
                if (flowCtrlPrivate) {
                    toBeUnloaded[2] = flowCtrlPrivate.$classpath;
                    toBeUnloaded[3] = flowCtrlPrivate.$publicInterfaceName;
                }
                var objectLoading = new ariaTemplatesObjectLoading();
                moduleCtrlPrivate.__$reloadingObject = objectLoading;
                moduleCtrlPrivate.$dispose();
                for (var i = 0, l = toBeUnloaded.length; i < l; i++) {
                    classMgr.unloadClass(toBeUnloaded[i], true);
                }
                loadSubModules.call(this, parentModule, [subModuleInfos.subModuleDesc], {
                    fn : reloadModuleCtrlCb,
                    scope : this,
                    args : {
                        objectLoading : objectLoading,
                        oldModuleCtrl : oldModuleCtrl,
                        oldFlowCtrl : oldFlowCtrl,
                        callback : cb
                    }
                }, subModuleInfos.customModule);
            }
function ( moduleCtrlPrivate , cb ) { var res = getModulePrivateInfoWithCheck ( moduleCtrlPrivate , "reloadModuleCtrl" ) ; if ( ! res ) { // error is already logged return ; } var subModuleInfos = res . subModuleInfos ; if ( subModuleInfos == null ) { this . $logError ( this . RELOAD_ONLY_FOR_SUBMODULES , [ moduleCtrlPrivate . $classpath ] ) ; return ; } var parentModule = subModuleInfos . parentModule ; this . $assert ( 668 , parentModule != null ) ; var oldModuleCtrl = res . moduleCtrl ; var oldFlowCtrl = res . flowCtrl ; var classMgr = ariaCoreClassMgr ; var toBeUnloaded = [ moduleCtrlPrivate . $classpath , moduleCtrlPrivate . $publicInterfaceName ] ; var flowCtrlPrivate = res . flowCtrlPrivate ; if ( flowCtrlPrivate ) { toBeUnloaded [ 2 ] = flowCtrlPrivate . $classpath ; toBeUnloaded [ 3 ] = flowCtrlPrivate . $publicInterfaceName ; } var objectLoading = new ariaTemplatesObjectLoading ( ) ; moduleCtrlPrivate . __$reloadingObject = objectLoading ; moduleCtrlPrivate . $dispose ( ) ; for ( var i = 0 , l = toBeUnloaded . length ; i < l ; i ++ ) { classMgr . unloadClass ( toBeUnloaded [ i ] , true ) ; } loadSubModules . call ( this , parentModule , [ subModuleInfos . subModuleDesc ] , { fn : reloadModuleCtrlCb , scope : this , args : { objectLoading : objectLoading , oldModuleCtrl : oldModuleCtrl , oldFlowCtrl : oldFlowCtrl , callback : cb } } , subModuleInfos . customModule ) ; }
Reload a module controller. A module can be dynamically reloaded only if it is a sub-module. To check if
a module controller is reloadable, you can use isModuleReloadable.
@param {aria.templates.ModuleCtrl} moduleCtrlPrivate module controller instance which is to be reloaded
@param {aria.core.CfgBeans:Callback} cb callback
Reload a module controller . A module can be dynamically reloaded only if it is a sub - module . To check if a module controller is reloadable you can use isModuleReloadable .