/*
(non-Javadoc)

@see com.ibm.ws.container.service.app.deploy.ModuleRuntimeContainer#createModuleMetaData(com.ibm.ws.container.service.app.deploy.ModuleInfo)
168782
@Override
    public ModuleMetaData createModuleMetaData(ExtendedModuleInfo moduleInfo) throws MetaDataException {
        Container container = moduleInfo.getContainer();
        ConnectorModuleMetaData cmmd;
        try {
            cmmd = container.adapt(ConnectorModuleMetaData.class);
        } catch (UnableToAdaptException e) {
            throw new MetaDataException(e);
        }
        return cmmd;
    }
1373852
@Beta
    // TODO maybe load with PELoader
    public MSDOSLoadModule readMSDOSLoadModule() throws IOException {
        MSDOSLoadModule module = new MSDOSLoadModule(msdos, file);
        module.read();
        return module;
    }
18777
function ImmutableCoreModule (moduleName, options) {
    // require name
    this.assert(typeof moduleName === 'string', 'name required')
    // require options to be an object
    var options = requireValidOptionalObject(options)
    // set module meta data
    this.meta = {
        name: moduleName,
        options: options,
    }
    // hidden variable for global meta data
    var data
    // create getter/setter for global meta data on meta
    Object.defineProperty(this.meta, 'data', {
        get: () => data,
        set: newData => {
            // validate data - throws on error
            newData = validateSetData(this, newData)
            // set data if defined
            if (defined(newData)) {
                data = newData
            }
        },
    })
    // create getter/setter for global meta data on instance
    Object.defineProperty(this, 'data', {
        get: () => data,
        set: newData => {
            // validate data - throws on error
            newData = validateSetData(this, newData)
            // set data if defined
            if (defined(newData)) {
                data = newData
            }
        },
    })
}
167565
async function loadModulesConfig()
{
    if(!modulesLoaded)
    {
		for (let i = 0; i < modules.length; i++) {
			await applyBotDataSource(modules[i]);
        }
        
        modulesLoaded = true;
    }
}
1236574
@Override
    public T addAsModules(final File... resources) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(resources, "resources must be specified");

        // Add each
        for (final File resource : resources) {
            this.addAsModule(resource);
        }

        // Return
        return this.covarientReturn();
    }
1158441
private void assertMetaDataQuota(final Long moduleId, final int requested) {
        final int maxMetaData = quotaManagement.getMaxMetaDataEntriesPerSoftwareModule();
        QuotaHelper.assertAssignmentQuota(moduleId, requested, maxMetaData, SoftwareModuleMetadata.class,
                SoftwareModule.class, softwareModuleMetadataRepository::countBySoftwareModuleId);
    }
1271701
@Override
    public void initModule() throws ModuleInitializationException {
        Map<String, String> parameters = getParameters();
        copyPropertiesOverParameters(parameters);
        serverInterface = new ServerWrapper(getServer());
        logger.info("Journaling parameters: " + parameters);
        parseParameters(parameters);

        if (inRecoveryMode) {
            worker =
                    new JournalConsumer(parameters, getRole(), serverInterface);
        } else {
            worker = new JournalCreator(parameters, getRole(), serverInterface);
        }
        logger.info("Journal worker module is: " + worker.toString());
    }
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);
        }
    }
242874
function loadMockModuleCallResolve (mockData, options) {
    // store moduleCallResolve data keyed by moduleCallId
    immutableAutomock.moduleCallResolveMocks[mockData.data.moduleCallId] = mockData.data
}
462693
@Override
    public void initModule() throws ModuleInitializationException {
        // pidNamespace (required, 1-17 chars, a-z, A-Z, 0-9 '-' '.')
        m_pidNamespace = getParameter("pidNamespace");
        if (m_pidNamespace == null) {
            throw new ModuleInitializationException(
                    "pidNamespace parameter must be specified.", getRole());
        }
        if (m_pidNamespace.length() > 17 || m_pidNamespace.length() < 1) {
            throw new ModuleInitializationException(
                    "pidNamespace parameter must be 1-17 chars long", getRole());
        }
        StringBuffer badChars = new StringBuffer();
        for (int i = 0; i < m_pidNamespace.length(); i++) {
            char c = m_pidNamespace.charAt(i);
            boolean invalid = true;
            if (c >= '0' && c <= '9') {
                invalid = false;
            } else if (c >= 'a' && c <= 'z') {
                invalid = false;
            } else if (c >= 'A' && c <= 'Z') {
                invalid = false;
            } else if (c == '-') {
                invalid = false;
            } else if (c == '.') {
                invalid = false;
            }
            if (invalid) {
                badChars.append(c);
            }
        }
        if (badChars.length() > 0) {
            throw new ModuleInitializationException("pidNamespace contains " +
                    "invalid character(s) '" + badChars.toString() + "'",
                    getRole());
        }
        // storagePool (optional, default=ConnectionPoolManager's default pool)
        m_storagePool = getParameter("storagePool");
        if (m_storagePool == null) {
            logger.debug("Parameter storagePool "
                    + "not given, will defer to ConnectionPoolManager's "
                    + "default pool.");
        }
        // internal storage format (required)
        logger.debug("Server property format.storage= " + Server.STORAGE_FORMAT);
        m_defaultStorageFormat = Server.STORAGE_FORMAT;
        if (m_defaultStorageFormat == null) {
            throw new ModuleInitializationException(
                    "System property format.storage "
                            + "not given, but it's required.", getRole());
        }
        // default export format (required)
        m_defaultExportFormat = getParameter("defaultExportFormat");
        if (m_defaultExportFormat == null) {
            throw new ModuleInitializationException(
                    "Parameter defaultExportFormat "
                            + "not given, but it's required.", getRole());
        }
        // storageCharacterEncoding (optional, default=UTF-8)
        m_storageCharacterEncoding = getParameter("storageCharacterEncoding");
        if (m_storageCharacterEncoding == null) {
            logger.debug("Parameter storage_character_encoding "
                    + "not given, using UTF-8");
            m_storageCharacterEncoding = "UTF-8";
        }
        initRetainPID();

        // readerCacheSize and readerCacheSeconds (optional, defaults = 20, 5)
        String rcSize = getParameter("readerCacheSize");
        if (rcSize == null) {
            logger.debug("Parameter readerCacheSize not given, using 20");
            rcSize = "20";
        }
        int readerCacheSize;
        try {
            readerCacheSize = Integer.parseInt(rcSize);
            if (readerCacheSize < 0) {
                throw new Exception("Cannot be less than zero");
            }
        } catch (Exception e) {
            throw new ModuleInitializationException(
                    "Bad value for readerCacheSize parameter: " +
                            e.getMessage(), getRole());
        }

        String rcSeconds = getParameter("readerCacheSeconds");
        if (rcSeconds == null) {
            logger.debug("Parameter readerCacheSeconds not given, using 5");
            rcSeconds = "5";
        }
        int readerCacheSeconds;
        try {
            readerCacheSeconds = Integer.parseInt(rcSeconds);
            if (readerCacheSeconds < 1) {
                throw new Exception("Cannot be less than one");
            }
        } catch (Exception e) {
            throw new ModuleInitializationException(
                    "Bad value for readerCacheSeconds parameter: " +
                            e.getMessage(), getRole());
        }

        // configuration of ingest validation
        String ingestValidationLevel = getParameter("ingestValidationLevel");
        if (ingestValidationLevel == null) {
            logger.debug("Ingest validation level not specified, using default of all");
            m_ingestValidationLevel = DOValidator.VALIDATE_ALL;
        } else {
            m_ingestValidationLevel = Integer.parseInt(ingestValidationLevel);
            // check the values.  better to declare the levels as enums, but this
            // would require DOValidator interface change
            if (m_ingestValidationLevel < -1 || m_ingestValidationLevel > 2) {
                throw new ModuleInitializationException(
                        "Bad value for ingestValidationLevel", getRole());
            }
        }
    }
6187
function addEntryComponentToModule(source, modulePath, classifiedName, importPath) {
    return addSymbolToNgModuleMetadata(source, modulePath, 'entryComponents', classifiedName, importPath);
}
32220
@Override
    public void generate(final Module module, final Element element) {
        if (!(module instanceof SimpleListExtension)) {
            return;
        }

        final SimpleListExtension sle = (SimpleListExtension) module;
        addNotNullElement(element, "treatAs", sle.getTreatAs());

        final Group[] groups = sle.getGroupFields();
        final Element listInfo = new Element("listinfo", ModuleParser.NS);

        for (int i = 0; groups != null && i < groups.length; i++) {
            final Element group = new Element("group", ModuleParser.NS);

            if (groups[i].getNamespace() != Namespace.NO_NAMESPACE) {
                addNotNullAttribute(group, "ns", groups[i].getNamespace().getURI());
            }

            addNotNullAttribute(group, "element", groups[i].getElement());
            addNotNullAttribute(group, "label", groups[i].getLabel());
            listInfo.addContent(group);
        }

        final Sort[] sorts = sle.getSortFields();

        for (int i = 0; sorts != null && i < sorts.length; i++) {
            final Element sort = new Element("sort", ModuleParser.NS);

            if (sorts[i].getNamespace() != Namespace.NO_NAMESPACE) {
                addNotNullAttribute(sort, "ns", sorts[i].getNamespace().getURI());
            }

            addNotNullAttribute(sort, "element", sorts[i].getElement());
            addNotNullAttribute(sort, "label", sorts[i].getLabel());
            addNotNullAttribute(sort, "data-type", sorts[i].getDataType());

            if (sorts[i].getDefaultOrder()) {
                addNotNullAttribute(sort, "default", "true");
            }

            listInfo.addContent(sort);
        }

        if (!listInfo.getChildren().isEmpty()) {
            element.addContent(listInfo);
        }
    }
1188749
function createModule(moduleName) {
    var schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var initialState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
    var namespaceActions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;


    if ((typeof moduleName === 'undefined' ? 'undefined' : _typeof(moduleName)) == 'object') {
        console.warn('createModule was called with what appears to be' + ' the deprecated 1.x signature (schema [, initalState , namespace]).' + ' Please update usage to the new format (moduleName, schema [, initialState, namespaceActions])' + ' before the next major release of create-redux-module.' + ' Attempting to convert to new format.');
        var map = {
            schema: moduleName,
            initialState: schema,
            namespaceActions: typeof initialState == 'string',
            moduleName: typeof initialState == 'string' ? initialState : 'unknown_module'
        };
        moduleName = map.moduleName;
        schema = map.schema;
        initialState = map.initialState;
        namespaceActions = map.namespaceActions;
    }

    var actions = {};
    var handlers = {};

    function createActionHandler(actionName) {
        var baseType = actionCase(actionName);

        if (typeof namespaceActions == 'string') {
            namespaceActions = [namespaceActions];
        }

        var actionType = namespaceActions === true || Array.isArray(namespaceActions) && namespaceActions.indexOf(actionName) > -1 ? moduleName + '/' + baseType : baseType;

        var actionCreator = createActionCreator(actionType);
        var handler = function handler(state, action) {
            return state;
        };

        var def = schema[actionName];
        if (def === null) {
            // default as above
        } else if (typeof def == 'function') {
            handler = def;
        } else if (Array.isArray(def)) {
            actionCreator = def[0] || actionCreator;
            handler = def[1] || handler;
        } else if ((typeof def === 'undefined' ? 'undefined' : _typeof(def)) == 'object' && def.promise) {
            schema[actionName] = createSchemaPromiseEntry(def, actionName, actions);
            createActionHandler(actionName);

            var requestActionName = actionName + 'Pending';
            schema[requestActionName] = createSchemaPendingEntry();
            createActionHandler(requestActionName);

            var successActionName = actionName + 'Success';
            schema[successActionName] = createSchemaSuccessEntry(def, successActionName);
            createActionHandler(successActionName);

            var failureActionName = actionName + 'Failure';
            schema[failureActionName] = createSchemaFailureEntry(def, failureActionName);
            createActionHandler(failureActionName);

            return;
        } else {
            throw new Error('Incorrect schema format, [' + actionName + '] must be a handlerFn, array, API object, Promise object, or null');
        }

        actions[actionName] = actionCreator.bind({
            moduleName: moduleName,
            baseType: baseType,
            type: actionType,
            actionName: actionName,
            actions: actions // reference other actions from this action
        });

        actions[actionName].toString = function () {
            return actionType.toString();
        };

        handlers[actionType] = handler;
    }

    Object.keys(schema).forEach(createActionHandler);

    var reducer = function reducer() {
        var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
        var action = arguments[1];

        var handler = handlers[action.type];
        return handler ? handler(state, action) : state;
    };

    // sas = [initialState, action, newState]
    var test = function test() {
        for (var _len3 = arguments.length, sas = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
            sas[_key3] = arguments[_key3];
        }

        sas.forEach(function (_ref) {
            var _ref2 = _slicedToArray(_ref, 3),
                initialState = _ref2[0],
                action = _ref2[1],
                newState = _ref2[2];

            _assert2.default.deepEqual(reducer(initialState, action), newState, moduleName + '.reducer' + ('(' + JSON.stringify(initialState)) + (', ' + JSON.stringify(action) + ') !== ') + ('' + JSON.stringify(newState)));
        });
    };

    var module = {
        actions: actions,
        reducer: reducer,
        mapDispatch: mapDispatch.bind(null, actions),
        test: test
    };
    module.toString = function () {
        return moduleName.toString();
    };

    return module;
}
501516
protected CmsProject createAndSetModuleImportProject(CmsObject cms, CmsModule module) throws CmsException {

        CmsProject importProject = cms.createProject(
            org.opencms.module.Messages.get().getBundle(cms.getRequestContext().getLocale()).key(
                org.opencms.module.Messages.GUI_IMPORT_MODULE_PROJECT_NAME_1,
                new Object[] {module.getName()}),
            org.opencms.module.Messages.get().getBundle(cms.getRequestContext().getLocale()).key(
                org.opencms.module.Messages.GUI_IMPORT_MODULE_PROJECT_DESC_1,
                new Object[] {module.getName()}),
            OpenCms.getDefaultUsers().getGroupAdministrators(),
            OpenCms.getDefaultUsers().getGroupAdministrators(),
            CmsProject.PROJECT_TYPE_TEMPORARY);
        cms.getRequestContext().setCurrentProject(importProject);
        cms.copyResourceToProject("/");
        return importProject;
    }
963899
protected void addModulesToJetty(HandlerCollection handlers) throws Exception {
    	/* *************
         * Manager API
         * ************* */
        ServletContextHandler apiManServer = new ServletContextHandler(ServletContextHandler.SESSIONS);
        addSecurityHandler(apiManServer);
        apiManServer.setContextPath("/apiman");
        apiManServer.addEventListener(new Listener());
        apiManServer.addEventListener(new BeanManagerResourceBindingListener());
        apiManServer.addEventListener(new ResteasyBootstrap());
        apiManServer.addFilter(LocaleFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        apiManServer.addFilter(ApimanCorsFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        apiManServer.addFilter(DisableCachingFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        addAuthFilter(apiManServer);
        apiManServer.addFilter(DefaultSecurityContextFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        apiManServer.addFilter(RootResourceFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        apiManServer.addFilter(ManagerApiMicroServiceTxWatchdogFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
        ServletHolder resteasyServlet = new ServletHolder(new HttpServletDispatcher());
        resteasyServlet.setInitParameter("javax.ws.rs.Application", ManagerApiMicroServiceApplication.class.getName());
        apiManServer.addServlet(resteasyServlet, "/*");

        apiManServer.setInitParameter("resteasy.injector.factory", "org.jboss.resteasy.cdi.CdiInjectorFactory");
        apiManServer.setInitParameter("resteasy.scan", "true");
        apiManServer.setInitParameter("resteasy.servlet.mapping.prefix", "");

        handlers.addHandler(apiManServer);

        /* ********** *
         * Manager UI *
         * ********** */
        ResourceHandler apimanUiServer = new ResourceHandler() {
            /**
             * @see org.eclipse.jetty.server.handler.ResourceHandler#getResource(java.lang.String)
             */
            @Override
            public Resource getResource(String path) {
                Resource resource = null;

                if (path == null || path.equals("/") || path.equals("/index.html")) {
                    path = "/index.html";
                }
                if (path.startsWith("/apimanui/api-manager") || path.equals("/apimanui") || path.equals("/apimanui/")) {
                    path = "/apimanui/index.html";
                }
                if (path.equals("/apimanui/apiman/config.js")) {
                    resource = getConfigResource(path);
                }
                if (path.equals("/apimanui/apiman/translations.js")) {
                    resource = getTranslationsResource(path);
                }

                if (resource == null) {
                    URL url = getClass().getResource(path);
                    if (url != null) {
                        resource = new ApimanResource(url);
                    }
                }

                return resource;
            }
        };
        apimanUiServer.setResourceBase("/apimanui/");
        apimanUiServer.setWelcomeFiles(new String[] { "index.html" });
        handlers.addHandler(apimanUiServer);
    }
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));
            }
        };
    }
308330
@Override
	public void onModuleLoad() {
		SampleTree.setTreeTitle(MESSAGES.treeTitle());

		// layer samples
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.openCycleMapTitle(),
				"[ISOMORPHIC]/geomajas/osgeo/layer-raster.png", OpenCycleMapSample.TITLE, "Layers",
				OpenCycleMapSample.FACTORY));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.tmsTitle(),
				"[ISOMORPHIC]/geomajas/osgeo/layer-raster.png", TmsSample.TITLE, "Layers",
				TmsSample.FACTORY));

		// Security samples:
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.treeGroupSecurity(),
				"[ISOMORPHIC]/geomajas/silk/key.png", SECURITY_GROUP, "topLevel"));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.layerSecurityTitle(),
				"[ISOMORPHIC]/geomajas/staticsecurity/key_go.png", LayerSecuritySample.LAYER_SECURITY_TITLE,
				SECURITY_GROUP, LayerSecuritySample.FACTORY));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.filterSecurityTitle(),
				"[ISOMORPHIC]/geomajas/staticsecurity/key_go.png", FilterSecuritySample.TITLE, SECURITY_GROUP,
				FilterSecuritySample.FACTORY));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.attributeSecurityTitle(),
				"[ISOMORPHIC]/geomajas/staticsecurity/key_go.png", AttributeSecuritySample.TITLE, SECURITY_GROUP,
				AttributeSecuritySample.FACTORY));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.commandSecurityTitle(),
				"[ISOMORPHIC]/geomajas/staticsecurity/key_go.png", CommandSecuritySample.TITLE, SECURITY_GROUP,
				CommandSecuritySample.FACTORY));
		SampleTreeNodeRegistry.addSampleTreeNode(new SampleTreeNode(MESSAGES.toolSecurityTitle(),
				"[ISOMORPHIC]/geomajas/staticsecurity/key_go.png", ToolSecuritySample.TITLE, SECURITY_GROUP,
				ToolSecuritySample.FACTORY));

		ExampleLayout exampleLayout = new ExampleLayout();

		exampleLayout.setAuthenticationHandler(new ShowcaseAuthenticationHandler());

		exampleLayout.buildUi();

		// security demo
		final Label userLabel = exampleLayout.getUserLabel();
		GwtCommandDispatcher dispatcher = GwtCommandDispatcher.getInstance();
		dispatcher.setTokenRequestHandler(new ShowcaseTokenRequestHandler());
		dispatcher.addTokenChangedHandler(new TokenChangedHandler() {
			public void onTokenChanged(TokenChangedEvent event) {
				String userId = null;
				if (null != event.getUserDetail()) {
					userId = event.getUserDetail().getUserId();
				}
				if (null == userId) {
					userLabel.setContents("No user is logged in.");
				} else {
					userLabel.setContents("Logged in with: " + userId);
					if (null != runOnLogin) {
						runOnLogin.run();
						runOnLogin = null;
					}
				}
			}
		});
		SsecAccess.login("luc", "luc", null);
	}