Sets a mod into the registry.
@param Mod $mod
186190
public function set(Mod $mod): void
    {
        $this->loadMods();
        $this->mods[$mod->getName()] = $mod;
    }
395658
public function setModule($module) {
        if (empty($module)) {
            throw new \Exception("Module cannot be empty", 0, null); //todo: create error code
        } else if (!is_string($module)) {
            throw new \Exception("Module must be a string", 0, null); //todo: create error code
        } else {
            $this->module = $module;
        }
    }
1158795
public void setModule(JSModule module) {
    // An input may only belong to one module.
    checkArgument(module == null || this.module == null || this.module == module);
    this.module = module;
  }
476835
public function saveMods(): void
    {
        $mods = [];
        foreach ($this->mods as $mod) {
            $mods[] = $mod->writeData();
        }
        $this->saveContent(self::HASH_FILE_MODS, $this->encodeContent($mods));
    }
1328922
private function _setModule()
	{
		if (preg_match('/^[a-z0-9_-]+$/', $this->_requestVars[0])) {
			$this->_module = $this->_requestVars[0];
        } else {
        	$this->_module = $this->_requestVars[0] = self::DEFAULT_MODULE;
        }

        return $this;
	}
364965
private function setByTypeModule(string $module, array $fields) : void
    {
        foreach ($fields as $field) {
            $this->setByTypeModuleField($module, $field);
        }
    }
1083983
public static function setCurrentModule(string $module): void
    {
        if (static::$currentModule !== null) {
            $currentModule = static::$currentModule;
            throw new ApplicationException("Current module was already set to {$currentModule}; once current module is set, you can't change it");
        }

        static::$currentModule = $module;

        // register current module & run init.php if present
        static::registerModule($module);
    }
799438
function(mods) {
			for (var i = 0, len = mods.length; i < len; i++) {
				if (!internal.is_module_ready(mods[i])) {
					return false;
				}
			}

			return true;
		}
104034
protected function isValidModification($mod)
    {
        return is_array($mod) &&
            array_key_exists(BatchModification::KEY_MODTYPE, $mod) &&
            array_key_exists(BatchModification::KEY_ATTRIB, $mod);
    }
1260832
def use(mod, opts = {})
      raise ArgumentError, "#{mod} is not a Mimi module" unless mod < Mimi::Core::Module
      mod.configure(opts)
      used_modules << mod unless used_modules.include?(mod)
      true
    end
1004976
public static function recursiveChmod($path, $mod = 0777)
    {
        $path = Normalize::diskFullPath($path);
        if (!self::exist($path)) {
            return;
        }

        $dir = new \DirectoryIterator($path);
        foreach ($dir as $item) {
            // change chmod for folders and files
            if ($item->isDir() || $item->isFile()) {
                chmod($item->getPathname(), 0777);
            }
            // try to recursive chmod folders
            if ($item->isDir() && !$item->isDot()) {
                self::recursiveChmod($item->getPathname(), $mod);
            }
        }
    }
1277429
function (runtime, modNames) {
            S.each(modNames, function (m) {
                Utils.createModuleInfo(runtime, m);
            });
        }
49493
public synchronized void setRegistry( MessagingClientFactoryRegistry registry ) {

		if( this.registry != null )
			this.registry.removeListener(this);

		this.registry = registry;
		if (registry != null)
			registry.addListener(this);
	}
701738
public function addModule($module) {
        $this->registerModule($module);
        if (is_object($module)) $module = $module->name;
        $this->userModules[] = $module;
    }
403848
def load(mod, persist=False):
    '''
    
    '''
    pre_mods = lsmod()
    res = __salt__['cmd.run_all']('modprobe {0}'.format(mod), python_shell=False)
    if res['retcode'] == 0:
        post_mods = lsmod()
        mods = _new_mods(pre_mods, post_mods)
        persist_mods = set()
        if persist:
            persist_mods = _set_persistent_module(mod)
        return sorted(list(mods | persist_mods))
    else:
        return 'Error loading module {0}: {1}'.format(mod, res['stderr'])
452732
void put(Modification mod) {
      switch (mod.getType()) {
         case STORE:
            modifications.put(((Store) mod).getKey(), mod);
            break;
         case REMOVE:
            modifications.put(((Remove) mod).getKey(), mod);
            break;
         case LIST:
            for (Modification m : ((ModificationsList) mod).getList())
               put(m);
            break;
         default:
            throw new IllegalArgumentException("Unknown modification type " + mod.getType());
      }
   }
1219543
public static void register(IMalisisMod mod, Object messageHandler)
	{
		register(mod, messageHandler.getClass(), messageHandler);
	}