/*
method to read all configuration values required by the initialisation
poller
555077
void init(Set<String> queues, 
            CapacitySchedulerConf capacityConf) {
    for (String queue : queues) {
      int userlimit = capacityConf.getMinimumUserLimitPercent(queue);
      int maxUsersToInitialize = ((100 / userlimit) + MAX_ADDITIONAL_USERS_TO_INIT);
      int maxJobsPerUserToInitialize = capacityConf
          .getMaxJobsPerUserToInitialize(queue);
      QueueInfo qi = new QueueInfo(queue, maxUsersToInitialize,
          maxJobsPerUserToInitialize);
      jobQueues.put(queue, qi);
    }
    sleepInterval = capacityConf.getSleepInterval();
    poolSize = capacityConf.getMaxWorkerThreads();
    if (poolSize > queues.size()) {
      poolSize = queues.size();
    }
    assignThreadsToQueues();
    Collection<JobInitializationThread> threads = threadsToQueueMap.values();
    for (JobInitializationThread t : threads) {
      if (!t.isAlive()) {
        t.setDaemon(true);
        t.start();
      }
    }
  }
362141
public static void initialize() {

        if (initialized) return;

        SniffyConfiguration.INSTANCE.addTopSqlCapacityListener(new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                ConcurrentLinkedHashMap<String, Timer> oldValues = globalSqlStats;
                globalSqlStats =
                        new ConcurrentLinkedHashMap.Builder<String, Timer>().
                                maximumWeightedCapacity(SniffyConfiguration.INSTANCE.getTopSqlCapacity()).
                                build();
                globalSqlStats.putAll(oldValues);
            }

        });


        if (SniffyConfiguration.INSTANCE.isMonitorSocket()) {

            try {
                SnifferSocketImplFactory.install();
            } catch (IOException e) {
                e.printStackTrace();
            }

        } else {

            SniffyConfiguration.INSTANCE.addMonitorSocketListener(new PropertyChangeListener() {

                private boolean sniffySocketImplFactoryInstalled = false;

                @Override
                public synchronized void propertyChange(PropertyChangeEvent evt) {
                    if (sniffySocketImplFactoryInstalled) return;
                    if (Boolean.TRUE.equals(evt.getNewValue())) {
                        try {
                            SnifferSocketImplFactory.install();
                            sniffySocketImplFactoryInstalled = true;
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }

            });

        }

        initialized = true;

    }
204249
@Override
    public void init(JsonSimpleConfig config) throws Exception {
        name = config.getString(null, "config", "name");
        if (name == null) {
            throw new Exception("Name name provided in queue configuration");
        }
        thread.setName(name);

        try {
            globalConfig = new JsonSimpleConfig();
            autoCommit = globalConfig.getBoolean(true, "indexer", "solr",
                    "autocommit");

            // Buffering
            docBuffer = new LinkedHashMap<String, String>();
            bufferSize = 0;
            bufferOldest = 0;
            bufferDocLimit = globalConfig.getInteger(BUFFER_LIMIT_DOCS,
                    "indexer", "buffer", "docLimit");
            bufferSizeLimit = globalConfig.getInteger(BUFFER_LIMIT_SIZE,
                    "indexer", "buffer", "sizeLimit");
            bufferTimeLimit = globalConfig.getInteger(BUFFER_LIMIT_TIME,
                    "indexer", "buffer", "timeLimit");

        } catch (IOException ioe) {
            log.error("Failed to read configuration: {}", ioe.getMessage());
            throw ioe;
        }
    }
973964
private void initConfig()
    {
        SystemConfiguration config = null;
        try {
            config = EFapsSystemConfiguration.get();
            if (config != null) {
                final Properties confProps = config.getAttributeValueAsProperties(KernelSettings.PWDSTORE);
                this.digesterConfig.setAlgorithm(confProps.getProperty(PasswordStore.ALGORITHM,
                                this.digesterConfig.getAlgorithm()));
                this.digesterConfig.setIterations(confProps.getProperty(PasswordStore.ITERATIONS,
                                this.digesterConfig.getIterations().toString()));
                this.digesterConfig.setSaltSizeBytes(confProps.getProperty(PasswordStore.SALTSIZE,
                                this.digesterConfig.getSaltSizeBytes().toString()));
                this.threshold = config.getAttributeValueAsInteger(KernelSettings.PWDTH);
            }
        } catch (final EFapsException e) {
            PasswordStore.LOG.error("Error on reading SystemConfiguration for PasswordStore", e);
        }

    }
768993
public ConfigSettings read()
	{

		ConfigSettings config = new ConfigSettings(ConfigEnum.IMPORT);

		String name;
		Node node;
		NodeList list = root.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			node = list.item(i);

			name = node.getNodeName().toUpperCase();

			if (name.equals(SECTION_MODE)) {
				parseModeConfig(node, config);
			}
			else if (name.equals(SECTION_EXTERNALS)) {
				parseExternalsConfig(node, config);
			}
			else if (name.equals(SECTION_INPUT)) {
				parseInputConfig(node, config);
			}
			else if (name.equals(SECTION_OUTPUT)) {
				parseOutputConfig(node, config);
			}
			else if (name.equals(SECTION_CACHE)) {
				parseCacheConfig(node, config);
			}
			else if (name.equals(SECTION_LOGGING)) {
				parseLoggingConfig(node, config);
			}
			else if (name.equals(SECTION_DEBUG)) {
				parseDebugConfig(node, config);
			}
			else if (name.equals(SECTION_FILTER)) {
				parseFilterConfig(node, config);
			}
		}

		return config;
	}
610878
@SneakyThrows
    @SuppressWarnings("FutureReturnValueIgnored")
    public void init() {
        if (!validateConfiguration()) {
            return;
        }

        val results = this.fetcher.fetch(getResources());
        ResourceCRLRevocationChecker.this.addCrls(results);

        final Runnable scheduledFetcher = () -> {
            try {
                val fetchedResults = getFetcher().fetch(getResources());
                ResourceCRLRevocationChecker.this.addCrls(fetchedResults);
            } catch (final Exception e) {
                LOGGER.debug(e.getMessage(), e);
            }
        };

        this.scheduler.scheduleAtFixedRate(
            scheduledFetcher,
            this.refreshInterval,
            this.refreshInterval,
            TimeUnit.SECONDS);

    }
1361796
private ModelNode readEndpointConfiguration() {
        ModelNode op = new ModelNode();
        op.get(ADDRESS).set(ENDPOINT_CONFIGURATION_ADDRESS.resolve(statementContext));
        op.get(OP).set(READ_RESOURCE_OPERATION);
        op.get(INCLUDE_RUNTIME).set(true);
        op.get(RECURSIVE).set(true);
        return op;
    }
285491
@Override
    public void read(final Reader reader) throws ConfigurationException, IOException {
        Preconditions.checkNotNull(reader);

        final HashMap<String, Object> settings = this.mapper.readValue(reader, HASH_MAP_TYPE_REFERENCE);
        final ImmutableNode rootNode = toNode(new Builder(), settings);
        this.getSubConfigurationParentModel().mergeRoot(rootNode, null, null, null, this);
    }
660462
private static HashMap<String, HashMap<String, String>> readConfigurations(
      ResourceLoader resourceLoader, String configFile, String className)
      throws IOException {
    HashMap<String, HashMap<String, String>> configs = null;
    InputStream reader = resourceLoader.openResource(configFile);
    // parse xml
    XMLInputFactory factory = XMLInputFactory.newInstance();
    try {
      XMLStreamReader streamReader = factory.createXMLStreamReader(reader);
      String currentElement = null;
      ArrayList<String> currentElements = new ArrayList<String>();
      QName qname;
      boolean skipCurrentConfigurations = false;
      try {
        int event = streamReader.getEventType();
        while (true) {
          switch (event) {
          case XMLStreamConstants.START_DOCUMENT:
            if (!streamReader.getCharacterEncodingScheme().equals("UTF-8")) {
              throw new IOException("XML not UTF-8 encoded");
            }
            break;
          case XMLStreamConstants.END_DOCUMENT:
            break;
          case XMLStreamConstants.SPACE:
            break;
          case XMLStreamConstants.START_ELEMENT:
            // get data
            qname = streamReader.getName();
            if (configs == null) {
              if (qname.getLocalPart().equals(CONFIGURATIONS_MTAS)) {
                configs = new HashMap<String, HashMap<String, String>>();
              } else {
                throw new IOException("no Mtas Configurations File");
              }
            } else if (currentElement != null
                && currentElement.equals(CONFIGURATIONS_MTAS)) {
              if (qname.getLocalPart().equals(CONFIGURATIONS_CONFIGURATIONS)) {
                skipCurrentConfigurations = true;
                if (className != null) {
                  for (int i = 0; i < streamReader.getAttributeCount(); i++) {
                    if (streamReader.getAttributeLocalName(i).equals("type")) {
                      if (streamReader.getAttributeValue(i).equals(className)) {
                        skipCurrentConfigurations = false;
                      }
                    }
                  }
                }
              } else {
                throw new IOException("unexpected " + qname.getLocalPart());
              }
            } else if (currentElement != null
                && currentElement.equals(CONFIGURATIONS_CONFIGURATIONS)
                && !skipCurrentConfigurations) {
              if (qname.getLocalPart().equals(CONFIGURATIONS_CONFIGURATION)) {
                String configurationName = null;
                HashMap<String, String> configurationValues = new HashMap<String, String>();
                for (int i = 0; i < streamReader.getAttributeCount(); i++) {
                  if (streamReader.getAttributeLocalName(i)
                      .equals(CONFIGURATIONS_CONFIGURATION_NAME)) {
                    configurationName = streamReader.getAttributeValue(i);
                  } else {
                    configurationValues.put(
                        streamReader.getAttributeLocalName(i),
                        streamReader.getAttributeValue(i));
                  }
                }
                if (configurationName != null) {
                  configs.put(configurationName, configurationValues);
                } else {
                  throw new IOException("configuration without "
                      + CONFIGURATIONS_CONFIGURATION_NAME);
                }
              } else {
                throw new IOException("unexpected tag " + qname.getLocalPart());
              }
            }
            currentElement = qname.getLocalPart();
            currentElements.add(currentElement);
            break;
          case XMLStreamConstants.END_ELEMENT:
            if (currentElement != null
                && currentElement.equals(CONFIGURATIONS_CONFIGURATIONS)) {
              skipCurrentConfigurations = false;
            }
            int i = currentElements.size();
            currentElements.remove((i - 1));
            if (i > 1) {
              currentElement = currentElements.get(i - 2);
            } else {
              currentElement = null;
            }
            break;
          case XMLStreamConstants.CHARACTERS:
            break;
          }
          if (!streamReader.hasNext()) {
            break;
          }
          event = streamReader.next();
        }
      } finally {
        streamReader.close();
      }
    } catch (XMLStreamException e) {
      log.debug(e);
    }
    return configs;
  }
1096240
@Override
    protected void initializeImpl()
    {
        //get values
        this.host=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.HOST_PROPERTY_KEY);
        if(this.host==null)
        {
            throw new FaxException("Host name not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.HOST_PROPERTY_KEY);
        }
        String valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PORT_PROPERTY_KEY);
        if(valueStr==null)
        {
            this.port=HylaFaxClientSpi.DEFAULT_PORT_PROPERTY_VALUE;
        }
        else
        {
            this.port=Integer.parseInt(valueStr);
        }
        this.userName=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.USER_NAME_PROPERTY_KEY);
        if(this.userName==null)
        {
            throw new FaxException("User name not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.USER_NAME_PROPERTY_KEY);
        }
        this.password=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PASSWORD_PROPERTY_KEY);
        this.enableAdminOperations=Boolean.parseBoolean(this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.ENABLE_ADMIN_OPERATIONS_PROPERTY_KEY));
        valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.MODE_PROPERTY_KEY);
        if(valueStr==null)
        {
            throw new FaxException("Mode not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.MODE_PROPERTY_KEY);
        }
        this.mode=valueStr.charAt(0);
        valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.TYPE_PROPERTY_KEY);
        if(valueStr==null)
        {
            throw new FaxException("Type not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.TYPE_PROPERTY_KEY);
        }
        this.type=valueStr.charAt(0);
    }
1363826
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params) {
            foreach ($params as $param) {
                if ($param->getType() == "config") {
                    $this->configParameters[] = $param;
                } else {
                    if ($param->getName() == "encoding") {
                        $this->setEncoding($param->getValue());
                    }
                }
            }
        }
    }
142089
@Override
	public void init(Configuration configuration)
	        throws Exception
	{
	    super.init(configuration);

        if (!(getLocalizationBundleFactory() instanceof JstlLocalizationBundleFactory))
        {
            BootstrapPropertyResolver propertyResolver = configuration.getBootstrapPropertyResolver();

            errorBundleName = propertyResolver.getProperty(ERROR_BUNDLE_NAME_CONFIG);
            LOGGER.debug("errorBundleName = ", errorBundleName == null ? "null" : '"' + errorBundleName + '"');

            fieldBundleName = propertyResolver.getProperty(FIELD_BUNDLE_NAME_CONFIG);
            LOGGER.debug("fieldBundleName = ", fieldBundleName == null ? "null" : '"' + fieldBundleName + '"');
        }
	}
1332108
def get_values():
    

    # First load a mapping between config name and default value
    default_initial = ((name, options[0])
                       for name, options in settings.CONFIG.items())
    # Then update the mapping with actually values from the backend
    initial = dict(default_initial, **dict(config._backend.mget(settings.CONFIG)))

    return initial
512887
function loadConfiguration() {
    let configuration;

    if (isInit()) {
        configuration = jsonReader('./.versionFilesList.json');

        // check configuration file's integrity
        if (!configuration.name || !configuration.currentVersion || !configuration.filesList || !configuration.versionPrefix) {
            sendError('E002');
        }

        // check .versionFilesList.json for missing informations
        if (configuration.name.length === 0 || configuration.currentVersion.length === 0) {
            sendError('E001');
        }
    }
    return configuration;
}
1051092
public static void initSystemProperties() {

        String implName;
        // initialize system properties
        if (System.getProperty(SAX_PARSER_FACTORY_KEY) == null) {
            implName = SAXParserFactory.newInstance().getClass().getName();
            LOG.info("Setting sax parser factory impl property to " + implName);
            System.setProperty(SAX_PARSER_FACTORY_KEY, implName);
        }
        if (System.getProperty(XML_READER_KEY) == null) {
            SAXReader reader = new SAXReader();
            try {
                implName = reader.getXMLReader().getClass().getName();
                LOG.info("Setting xml reader impl property to " + implName);
                System.setProperty(XML_READER_KEY, implName);
            } catch (SAXException e) {
                LOG.error("Error evaluating XMLReader impl.", e);
            }
        }
        if (System.getProperty(SAX_PARSER_CONFIG_KEY) == null) {
            ParserImpl saxParser = new ParserImpl();
            implName = saxParser.getConfigImplName();
            if (implName != null) {
                LOG.info("Setting xml parser configuration impl property to " + implName);
                System.setProperty(SAX_PARSER_CONFIG_KEY, implName);
            }
        }
    }
137173
private void readConfig(){
		AccumulatorsConfig config = MoskitoConfigurationHolder.getConfiguration().getAccumulatorsConfig();
		AccumulatorConfig[] acs = config.getAccumulators();
		if (acs!=null && acs.length>0){
			for (AccumulatorConfig ac  : acs){
				AccumulatorDefinition ad = new AccumulatorDefinition();
				ad.setName(ac.getName());
				ad.setIntervalName(ac.getIntervalName());
				ad.setProducerName(ac.getProducerName());
				ad.setStatName(ac.getStatName());
				ad.setTimeUnit(TimeUnit.valueOf(ac.getTimeUnit()));
				ad.setValueName(ac.getValueName());
				Accumulator acc = createAccumulator(ad);
				if (log.isDebugEnabled()){
					log.debug("Created accumulator "+acc);
				}
			}
		}

		AutoAccumulatorConfig[] autoAccumulatorConfigs = config.getAutoAccumulators();
		if (autoAccumulatorConfigs != null && autoAccumulatorConfigs.length>0){
			for (AutoAccumulatorConfig aac : autoAccumulatorConfigs){
				AutoAccumulatorDefinition aad = new AutoAccumulatorDefinition();
				aad.setNamePattern(aac.getNamePattern());
				aad.setProducerNamePattern(aac.getProducerNamePattern());
				aad.setIntervalName(aac.getIntervalName());
				aad.setValueName(aac.getValueName());
				aad.setStatName(aac.getStatName());
				aad.setTimeUnit(TimeUnit.fromString(aac.getTimeUnit()));
				aad.setAccumulationAmount(aac.getAccumulationAmount());
				autoAccumulatorDefinitions.add(aad);
			}
		}

	}
579836
function readFromLocalConfig(parent){
    return readFile(config_file(parent), "utf8")
        .then(function(contents){
            return JSON.parse(contents);
        })
        .catch(function(){
            return {
                data: {},
                installed: [],
            };
        });
}