Opens a mcrypt module.
@return A mcrypt module resource, or null if an error occurred.
760076
private function load()
	{
		if(strlen($this->_method) == 0 || strlen($this->_key) == 0)
			return null;
		$m = mcrypt_module_open($this->_type, '', $this->_mode, '');
		if($m === false)
			return null;
		// This check is performed by mcrypt_generic_init, but it's better
		// to do it now, because mcrypt_generic_init does not return a
		// negative or false value if it fails.
		$ivsize = mcrypt_enc_get_iv_size($m);
		if(strlen($this->_iv) != $ivsize)
		{
			// In ECB (and some other modes), the IV is not used but still
			// required to have the this size by mcrypt_generic_init, so
			// let's make a fake one.
			if(strtolower($this->_mode) == "ecb")
				$ivsize = str_repeat("\0", $ivsize);
			else
				return null;
		}
		$r = @mcrypt_generic_init($m, $this->_key, $this->_iv);
		if($r < 0 || $r === false)
			return null;
		return $m;
	}
951198
private static function useMcryptBacking()
    {
        if (!extension_loaded(self::BACKING_MCRYPT)) {
            throw new \RuntimeException(
                    'Can not use mcrypt backing, extension mcrypt not available'
            );
        }

        $engine   = mcrypt_module_open(MCRYPT_DES, '', 'ecb', '');
        $engineiv = mcrypt_create_iv(mcrypt_enc_get_iv_size($engine), MCRYPT_RAND);
        $key      = substr(md5(uniqid()), 0, mcrypt_enc_get_key_size($engine));
        mcrypt_generic_init($engine, $key, $engineiv);
        self::$encrypt = function($value) use($engine) { return mcrypt_generic($engine, $value); };
        self::$decrypt = function($value) use($engine) { return rtrim(mdecrypt_generic($engine, $value), "\0"); };
    }
935024
public AbstractModule createModule() {
        return new AbstractModule() {
            @Override
            protected void configure() {
                bind(IDataFactory.class).to(mDataFacClass);
                bind(IMetaEntryFactory.class).to(mMetaFacClass);
                bind(IRevisioning.class).to(mRevisioningClass);
                bind(IByteHandlerPipeline.class).toInstance(mByteHandler);
                install(new FactoryModuleBuilder().implement(IBackend.class, mBackend).build(
                    IBackendFactory.class));
                install(new FactoryModuleBuilder().build(IResourceConfigurationFactory.class));
                bind(Key.class).toInstance(mKey);
                install(new FactoryModuleBuilder().build(ISessionConfigurationFactory.class));
            }
        };
    }
888711
public Resource build() {
        Resource resource = null;
        if (_url != null) {
            resource = _kieResources.newUrlResource(_url);
            if (resource != null) {
                if (_resourceType != null) {
                    resource.setResourceType(_resourceType);
                }
                if (_resourceConfiguration != null) {
                    resource.setConfiguration(_resourceConfiguration);
                }
            }
        }
        return resource;
    }
153399
CmsModuleResourceSelectField createModuleResourceField(String moduleResource) {

        CmsModuleResourceSelectField resField = new CmsModuleResourceSelectField();
        CmsObject moduleCms = null;
        try {
            moduleCms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
            if (getSelectedSite() != null) {
                moduleCms.getRequestContext().setSiteRoot(getSelectedSite());
            }
            resField.setCmsObject(moduleCms);
            if (moduleResource != null) {
                resField.setValue(moduleResource);
            }
            return resField;
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            return null;
        }
    }
880559
public static SimpleModule getModule() {
        SimpleModule module = new SimpleModule();
        module.addSerializer(Base64Url.class, new Base64UrlSerializer());
        return module;
    }
1236205
function _setEngine()
    {
        $this->engine = null;

        $candidateEngines = array(
            $this->preferredEngine,
            self::ENGINE_OPENSSL,
            self::ENGINE_MCRYPT
        );
        foreach ($candidateEngines as $engine) {
            if ($this->isValidEngine($engine)) {
                $this->engine = $engine;
                break;
            }
        }
        if (!$this->engine) {
            $this->engine = self::ENGINE_INTERNAL;
        }

        if ($this->engine != self::ENGINE_MCRYPT && $this->enmcrypt) {
            // Closing the current mcrypt resource(s). _mcryptSetup() will, if needed,
            // (re)open them with the module named in $this->cipher_name_mcrypt
            @mcrypt_module_close($this->enmcrypt);
            @mcrypt_module_close($this->demcrypt);
            $this->enmcrypt = null;
            $this->demcrypt = null;

            if ($this->ecb) {
                @mcrypt_module_close($this->ecb);
                $this->ecb = null;
            }
        }

        $this->changed = true;
    }
298605
public static Module loadModule(InputStream in) throws IOException {
		Module module;
		DataInputStream din;
		byte[] xm_header, s3m_header, mod_header, output_buffer;
		int frames;
		
		din = new DataInputStream(in);
		module = null;
		xm_header = new byte[ 60 ];
		din.readFully( xm_header );
		
		if( FastTracker2.is_xm( xm_header ) ) {
			module = FastTracker2.load_xm( xm_header, din );
		} else {
			s3m_header = new byte[ 96 ];
			System.arraycopy( xm_header, 0, s3m_header, 0, 60 );
			din.readFully( s3m_header, 60, 36 );
			
			if( ScreamTracker3.is_s3m( s3m_header ) ) {
				module = ScreamTracker3.load_s3m( s3m_header, din );
			} else {
				mod_header = new byte[ 1084 ];
				System.arraycopy( s3m_header, 0, mod_header, 0, 96 );
				din.readFully( mod_header, 96, 988 );
				module = ProTracker.load_mod( mod_header, din );
			}
		}
		din.close();
		
		return module;
	}
540020
public Module loadModule(String l) {
        Module m = Module.load(l);
        modules.put(m.name(), m);
        return m;
    }
343716
public final static Function<BigInteger, BigInteger> module(long module) {
        return new Module(fromNumber(Long.valueOf(module)));
    }
237305
public static SimpleModule getModule() {
        SimpleModule module = new SimpleModule();
        module.addSerializer(Headers.class, new HeadersSerializer());
        return module;
    }
573611
async def loadmodule(self, module):
        '''
        
        '''
        self._logger.debug('Try to load module %r', module)
        if hasattr(module, '_instance'):
            self._logger.debug('Module is already initialized, module state is: %r', module._instance.state)
            if module._instance.state == ModuleLoadStateChanged.UNLOADING or module._instance.state == ModuleLoadStateChanged.UNLOADED:
                # Wait for unload
                um = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.UNLOADED)
                await um
            elif module._instance.state == ModuleLoadStateChanged.SUCCEEDED:
                pass
            elif module._instance.state == ModuleLoadStateChanged.FAILED:
                raise ModuleLoadException('Cannot load module %r before unloading the failed instance' % (module,))
            elif module._instance.state == ModuleLoadStateChanged.NOTLOADED or module._instance.state == ModuleLoadStateChanged.LOADED or module._instance.state == ModuleLoadStateChanged.LOADING:
                # Wait for succeeded or failed
                sm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.SUCCEEDED)
                fm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.FAILED)
                _, m = await M_(sm, fm)
                if m is sm:
                    pass
                else:
                    raise ModuleLoadException('Module load failed for %r' % (module,))
        if not hasattr(module, '_instance'):
            self._logger.info('Loading module %r', module)
            inst = module(self.server)
            # Avoid duplicated loading
            module._instance = inst
            # When reloading, some of the dependencies are broken, repair them
            if hasattr(module, 'referencedBy'):
                inst.dependedBy = set([m for m in module.referencedBy if hasattr(m, '_instance') and m._instance.state != ModuleLoadStateChanged.UNLOADED])
            # Load Module
            for d in module.depends:
                if hasattr(d, '_instance') and d._instance.state == ModuleLoadStateChanged.FAILED:
                    raise ModuleLoadException('Cannot load module %r, it depends on %r, which is in failed state.' % (module, d))
            try:
                for d in module.depends:
                    if hasattr(d, '_instance') and d._instance.state == ModuleLoadStateChanged.SUCCEEDED:
                        d._instance.dependedBy.add(module)
                preloads = [d for d in module.depends if not hasattr(d, '_instance') or \
                            d._instance.state != ModuleLoadStateChanged.SUCCEEDED]
                for d in preloads:
                    self.subroutine(self.loadmodule(d), False)
                sms = [ModuleLoadStateChanged.createMatcher(d, ModuleLoadStateChanged.SUCCEEDED) for d in preloads]
                fms = [ModuleLoadStateChanged.createMatcher(d, ModuleLoadStateChanged.FAILED) for d in preloads]
                def _callback(event, matcher):
                    raise ModuleLoadException('Cannot load module %r, it depends on %r, which is in failed state.' % (module, event.module))
                await self.with_callback(self.wait_for_all(*sms), _callback, *fms)
            except:
                for d in module.depends:
                    if hasattr(d, '_instance') and module in d._instance.dependedBy:
                        self._removeDepend(module, d)
                self._logger.warning('Loading module %r stopped', module, exc_info=True)
                # Not loaded, send a message to notify that parents can not 
                async def _msg():
                    await self.wait_for_send(ModuleLoadStateChanged(module, ModuleLoadStateChanged.UNLOADED, inst))
                self.subroutine(_msg(), False)
                del module._instance
                raise
            for d in preloads:
                d._instance.dependedBy.add(module)
            self.activeModules[inst.getServiceName()] = module
            await module._instance.changestate(ModuleLoadStateChanged.LOADING, self)
            await module._instance.load(self)
            if module._instance.state == ModuleLoadStateChanged.LOADED or module._instance.state == ModuleLoadStateChanged.LOADING:
                sm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.SUCCEEDED)
                fm = ModuleLoadStateChanged.createMatcher(module._instance.target, ModuleLoadStateChanged.FAILED)
                _, m = await M_(sm, fm)
                if m is sm:
                    pass
                else:
                    raise ModuleLoadException('Module load failed for %r' % (module,))
            self._logger.info('Loading module %r completed, module state is %r', module, module._instance.state)
            if module._instance.state == ModuleLoadStateChanged.FAILED:
                raise ModuleLoadException('Module load failed for %r' % (module,))
1086636
private MessageResources lookupDefaultStrutsBundle() {
        Object value = _servletRequest.getAttribute(Globals.MESSAGES_KEY);
        if(value instanceof MessageResources)
            return (MessageResources)value;
        else {
            if(value != null)
                LOGGER.warn("Can not resolve the default module bundle."
                    + "  The object resolved from the request is of type "
                    + value.getClass().toString());
            return null;
        }
    }
349513
@Nullable
  private Module getModuleFromScopeRoot(Node moduleBody) {
    if (moduleBody.isModuleBody()) {
      // TODO(b/128633181): handle ES modules here
      Node scriptNode = moduleBody.getParent();
      checkState(
          scriptNode.getBooleanProp(Node.GOOG_MODULE),
          "Typechecking of non-goog-modules not supported");
      Node googModuleCall = moduleBody.getFirstChild();
      String namespace = googModuleCall.getFirstChild().getSecondChild().getString();
      return moduleMap.getClosureModule(namespace);

    } else if (isGoogLoadModuleBlock(moduleBody)) {
      Node googModuleCall = moduleBody.getFirstChild();
      String namespace = googModuleCall.getFirstChild().getSecondChild().getString();
      return moduleMap.getClosureModule(namespace);
    }
    return null;
  }
666274
static <T> T loadAndInstantiateFromModule(final String moduleId, final Class<T> iface, final String name) throws Exception {
        if (!WildFlySecurityManager.isChecking()) {
            return internalLoadAndInstantiateFromModule(moduleId, iface, name);
        } else {
            try {
                return doPrivileged(new PrivilegedExceptionAction<T>() {
                    @Override
                    public T run() throws Exception {
                        return internalLoadAndInstantiateFromModule(moduleId, iface, name);
                    }
                });
            } catch (PrivilegedActionException e) {
                Throwable t = e.getCause();
                if (t instanceof RuntimeException){
                    throw (RuntimeException)t;
                }
                throw new Exception(t);
            }
        }
    }
424980
public void loadModule(final JsiiModule module) {
        try {
            String tarball = extractResource(module.getModuleClass(), module.getBundleResourceName(), null);
            ObjectNode req = makeRequest("load");
            req.put("tarball", tarball);
            req.put("name", module.getModuleName());
            req.put("version", module.getModuleVersion());
            this.runtime.requestResponse(req);
        } catch (IOException e) {
            throw new JsiiException("Unable to extract resource " + module.getBundleResourceName(), e);
        }
    }
90765
private static void handleRealModule(final Object module, final Set<Object> visitedModules,
            final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec,
            final LogNode log) {
        if (!visitedModules.add(module)) {
            // Avoid extracting paths from the same module more than once
            return;
        }
        ClassLoader moduleLoader = (ClassLoader) ReflectionUtils.invokeMethod(module, "getClassLoader", false);
        if (moduleLoader == null) {
            moduleLoader = classLoader;
        }
        // type VFSResourceLoader[]
        final Object vfsResourceLoaders = ReflectionUtils.invokeMethod(moduleLoader, "getResourceLoaders", false);
        if (vfsResourceLoaders != null) {
            for (int i = 0, n = Array.getLength(vfsResourceLoaders); i < n; i++) {
                // type JarFileResourceLoader for jars, VFSResourceLoader for exploded jars, PathResourceLoader
                // for resource directories, or NativeLibraryResourceLoader for (usually non-existent) native
                // library "lib/" dirs adjacent to the jarfiles that they were presumably extracted from.
                final Object resourceLoader = Array.get(vfsResourceLoaders, i);
                // Could skip NativeLibraryResourceLoader instances altogether, but testing for their existence
                // only seems to add about 3% to the total scan time.
                // if (!resourceLoader.getClass().getSimpleName().equals("NativeLibraryResourceLoader")) {
                handleResourceLoader(resourceLoader, moduleLoader, classpathOrderOut, scanSpec, log);
                //}
            }
        }
    }