Configure the server from an XML file.
@param configuration The filename or URL of the XML
configuration file.
766876
public void configure(String configuration)
        throws IOException
    {

        URL url=Resource.newResource(configuration).getURL();
        if (_configuration!=null && _configuration.equals(url.toString()))
            return;
        if (_configuration!=null)
            throw new IllegalStateException("Already configured with "+_configuration);
        try
        {
            XmlConfiguration config=new XmlConfiguration(url);
            _configuration=url.toString();
            config.configure(this);
        }
        catch(IOException e)
        {
            throw e;
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
            throw new IOException("Jetty configuration problem: "+e);
        }
    }
383768
private void configureServer(ServerBartender server)
  {
    // XXX: mixing server/client
    
    ServerNetwork serverNet = _serverMap.get(server.getId());
    
    if (serverNet == null) {
      serverNet = new ServerNetwork(_system, server);
      
      configServer(serverNet, server);

      serverNet.init();
      
      _serverMap.put(server.getId(), serverNet);
    }
  }
366158
public static void init(Properties configuration) {

        for (Object prop : configuration.keySet()) {
            String serverPropertyName = (String) prop;
            System.setProperty(PROPERTY_PREFIX + serverPropertyName, configuration.getProperty(serverPropertyName));
        }

        // Read system properties
        LOG.info("Using configuration provided using '-D' parameter and/or default values");
        EsigateServer.port = getProperty(PROPERTY_PREFIX, "port", PROPERTY_DEFAULT_HTTP_PORT);
        EsigateServer.controlPort = getProperty(PROPERTY_PREFIX, "controlPort", PROPERTY_DEFAULT_CONTROL_PORT);
        EsigateServer.contextPath = getProperty(PROPERTY_PREFIX, "contextPath", "/");
        EsigateServer.extraClasspath = getProperty(PROPERTY_PREFIX, "extraClasspath", null);
        EsigateServer.maxThreads = getProperty(PROPERTY_PREFIX, "maxThreads", 500);
        EsigateServer.minThreads = getProperty(PROPERTY_PREFIX, "minThreads", 40);
        EsigateServer.outputBufferSize = getProperty(PROPERTY_PREFIX, "outputBufferSize", 8 * 1024);
        EsigateServer.idleTimeout = getProperty(PROPERTY_PREFIX, "idleTimeout", 30 * 1000);
        EsigateServer.sessionCookieName = getProperty(PROPERTY_PREFIX, "sessionCookieName", null);
    }
465872
public final synchronized void initialize(Map<String,String> configuration)
    {
        if(this.initialized)
        {
            throw new FaxException("Request parser already initialized.");
        }
        
        //set flag
        this.initialized=true;
        
        //initialize
        this.initializeImpl(configuration);
    }
415450
public MasterWebUIConfiguration setConfiguration(
      TreeSet<Triple<String, String, String>> configuration) {
    mConfiguration = configuration;
    return this;
  }
1222181
public function initConfiguration(Configuration $configuration = null)
    {
        if (isset($configuration)) {
            $this->configuration = $configuration;
        }

        if (isset($this->configuration)) {
            $this->setLogger($this->configuration->getLogger());
            $this->componentFactory = null;
            $this->prepareFactory();
        }
    }
1262238
public void setConfigFile(final String config) {
        if (config == null) {
            throw (new IllegalArgumentException(
                    "Configuration file parameter is null"));
        }
        File file = new File(config);
        if (file.exists()) {
            if (file.isDirectory()) {
                throw new IllegalArgumentException("Folder " + config
                        + " is not a configuration file");
            }
        } else {
            throw new IllegalArgumentException("Configuration file " + config
                    + " not found");
        }
        setConfigFile(file);
    }
1256574
public static void configure(Properties configuration) {

        boolean activate = "true".equalsIgnoreCase(configuration
                .getProperty(Constants.ANDROLOG_ACTIVE));
        if (activate) {
            activateLogging();
        }

        boolean activate4Report = "true".equalsIgnoreCase(configuration
                .getProperty(Constants.ANDROLOG_REPORT_ACTIVE));
        if (activate4Report) {
            activateReporting();
        }

        detectWTFMethods();

        if (configuration.containsKey(Constants.ANDROLOG_DEFAULT_LEVEL)) {
            String level = configuration.getProperty(Constants.ANDROLOG_DEFAULT_LEVEL);
            defaultLogLevel = LogHelper.getLevel(level, defaultLogLevel);
        }

        if (configuration.containsKey(Constants.ANDROLOG_REPORT_DEFAULT_LEVEL)) {
            String level = configuration
                    .getProperty(Constants.ANDROLOG_REPORT_DEFAULT_LEVEL);
            defaultReportLevel = LogHelper.getLevel(level, defaultReportLevel);
        }

        @SuppressWarnings("unchecked")
        Enumeration<String> names = (Enumeration<String>) configuration
                .propertyNames();
        while (names.hasMoreElements()) {
            String name = names.nextElement();
            if (!name.startsWith(Constants.ANDROLOG_PREFIX)) {
                String level = configuration.getProperty(name);
                int log = LogHelper.getLevel(level, defaultLogLevel);
                logLevels.put(name, log);
            }
        }

        if (useWTF) {
            // Check if androlog configuration does not override this.
            if (configuration.containsKey(Constants.ANDROLOG_DELEGATE_WTF)) {
                String v = configuration.getProperty(Constants.ANDROLOG_DELEGATE_WTF);
                // If androlog.delegate.wtf is set to true, we really call
                // Log.wtf which
                // may terminate the process.
                useWTF = "true".equals(v.toLowerCase());
                // In other cases, androlog does log a message in the Constants.ASSERT
                // level.
            }
        }

        // Do we need to store the log entries for Reports ?
        enableLogEntryCollection = false;
        if (context != null
                && configuration.containsKey(Constants.ANDROLOG_REPORT_REPORTERS)) {
            // We enable the collection only if we have reporters AND a valid
            // context
            String s = configuration.getProperty(Constants.ANDROLOG_REPORT_REPORTERS);
            String[] senders = s.split(",");
            for (String sender : senders) {
                String cn = sender.trim();
                Reporter reporter = InstanceFactory.newReporter(cn);
                if (reporter != null) {
                    reporter.configure(configuration);
                    reporters.add(reporter);
                }
            }

            // Configure the UncaughtExceptionHandler
            if (configuration.containsKey(Constants.ANDROLOG_REPORT_EXCEPTION_HANDLER)
                    && "false".equals(configuration.getProperty(Constants.ANDROLOG_REPORT_EXCEPTION_HANDLER))) {
                exceptionHandlerActivated = false;
            }

            if (configuration.containsKey(Constants.ANDROLOG_REPORT_EXCEPTION_HANDLER_PROPAGATION)
                    && "false".equals(configuration.getProperty(Constants.ANDROLOG_REPORT_EXCEPTION_HANDLER_PROPAGATION))) {
                exceptionHandlerPropagation = false;
            }

            // Define an default error handler, reporting the error.
            if (exceptionHandlerActivated) {
                originalHandler = Thread.getDefaultUncaughtExceptionHandler();
                Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
                    @Override
                    public void uncaughtException(Thread arg0, Throwable arg1) {
                        report("Uncaught Exception", arg1);
                        // If there is a original handler, propagate the exception.
                        if (exceptionHandlerPropagation  && originalHandler != null) {
                            originalHandler.uncaughtException(arg0, arg1);
                        }
                    }
                });
            }

            if (configuration.containsKey(Constants.ANDROLOG_REPORT_TRIGGER_LEVEL)) {
                String l = configuration.getProperty(Constants.ANDROLOG_REPORT_TRIGGER_LEVEL);
                reportTriggerLevel = LogHelper.getLevel(l, defaultReportLevel);
            } else {
                reportTriggerLevel = Constants.ASSERT;
            }
            
            if (configuration.containsKey(Constants.ANDROLOG_REPORT_FACTORY)) {
                s = configuration.getProperty(Constants.ANDROLOG_REPORT_FACTORY);
                reportFactory = InstanceFactory.newReportFactory(s);
            }
            
            if ("true".equalsIgnoreCase(configuration
                .getProperty(Constants.ANDROLOG_REPORT_ADD_TIMESTAMP))) {
                addTimestampToReportLogs = true;
            }
            
            enableLogEntryCollection = true;
        }

        if (enableLogEntryCollection) {
            if (configuration.containsKey(Constants.ANDROLOG_REPORT_LOG_ITEMS)) {
                String p = configuration.getProperty(Constants.ANDROLOG_REPORT_LOG_ITEMS);
                maxOfEntriesInReports = Integer.parseInt(p);
            } else {
                maxOfEntriesInReports = 25; // Default
            }
            entries = new ArrayList<String>(maxOfEntriesInReports);
        }

    }
687449
@Override
    public void configure(String parameters) {
        if (parameters.isEmpty()) {
            return;
        }
        List<String> values = Op.split(parameters, " ");
        int required = 2;
        if (values.size() < required) {
            throw new RuntimeException(String.format(
                    "[configuration error] term <%s> requires <%d> parameters",
                    this.getClass().getSimpleName(), required));
        }
        Iterator<String> it = values.iterator();
        setCenter(Op.toDouble(it.next()));
        setWidth(Op.toDouble(it.next()));
        if (values.size() > required) {
            setHeight(Op.toDouble(it.next()));
        }
    }
1088023
public void setConfig(Configuration config) {
		if (config == null) {
			throw new IllegalArgumentException("Parameter config must not be null.");
		}
	    this.config = config;
	    this.loadFrom(config);
	}
570344
public void setConiguration(Configuration configuration) {
        this.configuration = configuration;
        getLoader().setConfiguration(configuration);
        getSaver().setConfiguration(configuration);
    }
394847
public void setConfig(CompilerConfiguration config) {
        if (config == null) throw new NullPointerException("configuration cannot be null");
        this.config = config;
        this.groovyLoader = initGroovyLoader();
    }
65904
public void setConfigure(java.util.Collection<String> configure) {
        if (configure == null) {
            this.configure = null;
            return;
        }

        this.configure = new com.amazonaws.internal.SdkInternalList<String>(configure);
    }
478817
@Override
	public void configure(Configuration parameters) {
		// get the file path
		String filePath = parameters.getString(FILE_PARAMETER_KEY, null);
		if (filePath != null) {
			try {
				this.filePath = new Path(filePath);
			}
			catch (RuntimeException rex) {
				throw new RuntimeException("Could not create a valid URI from the given file path name: " + rex.getMessage()); 
			}
		}
		else if (this.filePath == null) {
			throw new IllegalArgumentException("File path was not specified in input format, or configuration."); 
		}
	}
932377
@FFDCIgnore(XMLStreamException.class)
    public boolean parseServerConfiguration(InputStream in, String docLocation, BaseConfiguration config,
                                            MergeBehavior mergeBehavior) throws ConfigParserException, ConfigValidationException {
        XMLStreamReader parser = null;
        try {
            parser = getXMLInputFactory().createXMLStreamReader(docLocation, in);
            return parseServerConfiguration(new DepthAwareXMLStreamReader(parser), docLocation, config, mergeBehavior);
        } catch (XMLStreamException e) {
            throw new ConfigParserException(e);
        } finally {
            if (parser != null) {
                try {
                    parser.close();
                } catch (XMLStreamException e) {
                    throw new ConfigParserException(e);
                }
            }
        }
    }
48562
public static ServerConfiguration load(URL url) throws Exception
    {
        config = new ServerConfiguration();
        config.loadConfig(url);
        return config;
    }
680686
public void setConfiguredProperties(BeanConfiguration configuration) {
        boolean changed = false;
        final Set<ConfiguredPropertyDescriptor> properties = getDescriptor().getConfiguredProperties();
        for (ConfiguredPropertyDescriptor property : properties) {
            final Object value = configuration.getProperty(property);
            final boolean changedValue = setConfiguredPropertyIfChanged(property, value);
            if (changedValue) {
                changed = true;
            }
        }
        if (changed) {
            onConfigurationChanged();
        }
    }