Configures the JRE.
498311
function configure_jre() {
    console.log("  Configuring JRE ...");

    var mb = 1024*1024;

    // Test if there is already a global Java so we don't need to download anything
    ClosureCompiler.testJava(ClosureCompiler.getGlobalJava(), function(ok) {
        if (ok) {
            console.log("  ✔ Global Java is available, perfect!\n");
            // Travis CI for example has one, so we save their bandwidth. And Google's. And yours. And...
            finish();
        } else {
            if (fs.existsSync(path.join(__dirname, "..", "jre", "bin"))) {
                console.log("  ✖ Global Java not found or outdated, testing bundled JRE ...\n");
                runTest(true);
            } else {
                console.log("  ✖ Global Java not found or outdated, downloading bundled JRE ...");
                console.log("    Downloading "+jreUrl+" ...");
                lastBytes = 0; currentBytes = 0;
                download(jreUrl, jreTempFile, function(error, bytes) {
                    if (error) {
                        console.log("    ✖ Download failed: "+error+"\n");
                        fail();
                    }
                    console.log("    ✔ Download complete: "+jreTempFile+" ("+parseInt(bytes/mb, 10)+" mb)\n");
                    setTimeout(function() {
                        console.log("      Unpacking "+jreTempFile+" ...");
                        unpack(jreTempFile, function(error) {
                            if (error) {
                                console.log("      ✖ Unpack failed: "+error+"\n");
                                fail();
                            }
                            setTimeout(function() { // Let the entry callbacks finish
                                console.log("      ✔ Unpack complete.\n");
                                configure();
                                runTest(true);
                            }, 1000);
                        }, function(entry) {
                            console.log("      | "+entry["path"]);
                        });
                    }, 1000);
                }, function(bytes, total) {
                    currentBytes += bytes;
                    if (currentBytes == bytes || currentBytes - lastBytes >= mb) {
                        console.log("    | "+parseInt(currentBytes/mb, 10)+" / "+(total > 0 ? parseInt(total/mb, 10) : "???")+" mb");
                        lastBytes = currentBytes;
                    }
                });
            }
        }
    });
}
360532
protected function configure()
    {
        $this->bind(ResourceInterface::class)->to(Resource::class)->in(Scope::SINGLETON);
        $this->bind(InvokerInterface::class)->to(Invoker::class);
        $this->bind(LinkerInterface::class)->to(Linker::class);
        $this->bind(FactoryInterface::class)->to(Factory::class);
        $this->bind(SchemeCollectionInterface::class)->toProvider(SchemeCollectionProvider::class);
        $this->bind(AnchorInterface::class)->to(Anchor::class);
        $this->bind(NamedParameterInterface::class)->to(NamedParameter::class);
        $this->bind(RenderInterface::class)->to(PrettyJsonRenderer::class)->in(Scope::SINGLETON);
        $this->bind(Cache::class)->to(ArrayCache::class);
        $this->bind(RenderInterface::class)->annotatedWith('options')->to(OptionsRenderer::class);
        $this->bind(OptionsMethods::class);
        $this->bind(NamedParamMetasInterface::class)->to(NamedParamMetas::class);
    }
597020
protected function configure(): void
    {
        $this->setName('dependency-guard');
        $this->setDescription(
            'Check Composer dependencies for a --no-dev install.'
        );

        $this->addOption(
            'format',
            'f',
            InputOption::VALUE_REQUIRED,
            'The output format. '
                . implode(
                    ', ',
                    array_map(
                        function (string $format) : string {
                            return sprintf('<comment>%s</comment>', $format);
                        },
                        $this->exporterFactory->getOutputFormats()
                    )
                ),
            ViolationExporterFactoryInterface::DEFAULT_FORMAT
        );
    }
362393
@Override
  protected void configure() {

    // Bind and expose LogWriter (a bit hacky, but needed by MapReduce for now)
    bind(LogWriter.class).to(LocalLogWriter.class);
    expose(LogWriter.class);

    // Bind ServiceAnnouncer for procedure.
    bind(ServiceAnnouncer.class).to(DiscoveryServiceAnnouncer.class);

    // For Binding queue stuff
    bind(QueueReaderFactory.class).in(Scopes.SINGLETON);

    // Bind ProgramRunner
    MapBinder<ProgramRunnerFactory.Type, ProgramRunner> runnerFactoryBinder =
      MapBinder.newMapBinder(binder(), ProgramRunnerFactory.Type.class, ProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOW).to(FlowProgramRunner.class);
    runnerFactoryBinder.addBinding(ProgramRunnerFactory.Type.FLOWLET).to(FlowletProgramRunner.class);

    bind(ProgramRunnerFactory.class).to(InMemoryFlowProgramRunnerFactory.class).in(Scopes.SINGLETON);
    // Note: Expose for test cases. Need to refactor test cases.
    expose(ProgramRunnerFactory.class);

    // For binding DataSet transaction stuff
    install(new DataFabricFacadeModule());
  }
912281
@Override
	public void configure(Configuration parameters) {
		this.driverName = parameters.getString(DRIVER_KEY, null);
		this.username = parameters.getString(USERNAME_KEY, null);
		this.password = parameters.getString(PASSWORD_KEY, null);
		this.dbURL = parameters.getString(URL_KEY, null);
		this.query = parameters.getString(QUERY_KEY, null);
		this.fieldCount = parameters.getInteger(FIELD_COUNT_KEY, 0);
		this.batchInterval = parameters.getInteger(BATCH_INTERVAL, DEFAULT_BATCH_INTERVERAL);

		@SuppressWarnings("unchecked")
		Class<Value>[] classes = new Class[this.fieldCount];
		this.fieldClasses = classes;

		for (int i = 0; i < this.fieldCount; i++) {
			@SuppressWarnings("unchecked")
			Class<? extends Value> clazz = (Class<? extends Value>) parameters.getClass(FIELD_TYPE_KEY + i, null);
			if (clazz == null) {
				throw new IllegalArgumentException("Invalid configuration for JDBCOutputFormat: "
						+ "No type class for parameter " + i);
			}
			this.fieldClasses[i] = clazz;
		}
	}
827056
private void configure(final Container container)
    {
        try
        {
            // Use invokeAndWait so that we can be sure that initialisation is complete
            // before continuing.
            SwingUtilities.invokeAndWait(new Runnable()
            {
                public void run()
                {
                    try
                    {
                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                    }
                    catch (Exception ex)
                    {
                        // This should never happen as we are installing a known look-and-feel.
                        System.err.println("Failed to load System look-and-feel.");
                    }
                    prepareGUI(container);
                }
            });
        }
        catch (InterruptedException ex)
        {
            // Restore interrupt flag.
            Thread.currentThread().interrupt();
        }
        catch (InvocationTargetException ex)
        {
            ex.getCause().printStackTrace();
            JOptionPane.showMessageDialog(container, ex.getCause(), "Error Occurred", JOptionPane.ERROR_MESSAGE);
        }
    }
21288
def configure(config=None, bind_in_runtime=True):
    """"""
    global _INJECTOR

    with _INJECTOR_LOCK:
        if _INJECTOR:
            raise InjectorException('Injector is already configured')

        _INJECTOR = Injector(config, bind_in_runtime=bind_in_runtime)
        logger.debug('Created and configured an injector, config=%s', config)
        return _INJECTOR
1138819
@Override
    protected void configure() {

        install(Modules.override(new WhenBinder()).with(new OverridesGuiceWhenBinder()));

        bind(WhenVertx.class).to(DefaultWhenVertx.class).in(Singleton.class);
        bind(WhenEventBus.class).to(DefaultWhenEventBus.class).in(Singleton.class);
        bind(WhenHttpClient.class).to(DefaultWhenHttpClient.class).in(Singleton.class);
        bind(WhenFileSystem.class).to(DefaultWhenFileSystem.class).in(Singleton.class);
        bind(PromiseAdapter.class).to(DefaultPromiseAdapter.class).in(Singleton.class);

    }
431311
@Override
	public void configure(Configuration parameters) {
		// get the output file path, if it was not yet set
		if (this.outputFilePath == null) {
			// get the file parameter
			String filePath = parameters.getString(FILE_PARAMETER_KEY, null);
			if (filePath == null) {
				throw new IllegalArgumentException("The output path has been specified neither via constructor/setters" +
						", nor via the Configuration.");
			}
			
			try {
				this.outputFilePath = new Path(filePath);
			}
			catch (RuntimeException rex) {
				throw new RuntimeException("Could not create a valid URI from the given file path name: " + rex.getMessage()); 
			}
		}
		
		// check if have not been set and use the defaults in that case
		if (this.writeMode == null) {
			this.writeMode = DEFAULT_WRITE_MODE;
		}
		
		if (this.outputDirectoryMode == null) {
			this.outputDirectoryMode = DEFAULT_OUTPUT_DIRECTORY_MODE;
		}
	}
316342
protected function configure()
    {
        $this
            ->setName('detect')
            ->setDefinition(
                [
                    new InputArgument('path', InputArgument::OPTIONAL, 'path of the project', null),
                    new InputOption(
                        'config-file',
                        'c',
                        InputOption::VALUE_REQUIRED,
                        'File path of the configuration file'
                    ),
                    new InputOption(
                        'format',
                        'f',
                        InputOption::VALUE_REQUIRED,
                        sprintf('Output format (%s)', implode(', ', $this->formats)),
                        $this->formats[0]
                    ),
                ]
            )
            ->setDescription('Detect coupling rules')
            ->setHelp($this->loadHelpContent());
    }
564303
public void configure() {
		ServletContext servletContext = ServletActionContext.getServletContext();

		ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver(servletContext);
		templateResolver.setTemplateMode(templateMode);
		templateResolver.setCharacterEncoding(characterEncoding);
		templateResolver.setPrefix(prefix);
		templateResolver.setSuffix(suffix);
		templateResolver.setCacheable(cacheable);
		templateResolver.setCacheTTLMs(cacheTtlMillis);

		templateEngine.setTemplateResolver(templateResolver);
		StrutsMessageResolver messageResolver = new StrutsMessageResolver();
		templateEngine.setMessageResolver(new StrutsMessageResolver());
		if (templateEngine instanceof SpringTemplateEngine) {
			((SpringTemplateEngine) templateEngine).setMessageSource(messageResolver.getMessageSource());
		}

		// extension diarects.
		FieldDialect fieldDialect = new FieldDialect(TemplateMode.HTML ,"sth");
		templateEngine.addDialect(fieldDialect);
	}
376781
@Override
    protected void configure() {

        bind(ChannelService.class).to(ChannelServiceImpl.class);
        bind(MonitoringService.class).to(MonitoringServiceImpl.class);

        bind(TimestampProvider.class).to(SystemTimeProvider.class);

        bind(ChannelAssignmentStrategy.class).to(RoundRobinAssignmentStrategy.class);
    }
658658
def configure_importer
      # The default package conforms to the JRuby convention for mapping a package name
      # to a module name.
      @packages ||= [name.split('::').map { |n| n.downcase }.join('.')]
      @packages.each do |pkg|
        begin
          eval "java_package Java::#{pkg}"
        rescue Exception => e
          raise ArgumentError.new("#{self} Java package #{pkg} not found - #{$!}")
        end
      end
      # The introspected classes.
      @introspected = Set.new
      # The name => file hash for file definitions that are not in the packages.
      @unresolved_defs = {}
    end
280463
protected function configure()
    {
        parent::configure();

        $this
            ->setName('run_jobs')
            ->setDescription('Run jobs that are next in line for up to N seconds')
            ->addOption(
                'seconds',
                's',
                InputOption::VALUE_REQUIRED,
                'Run jobs for -s seconds before quitting the process',
                50
            )
            ->addOption(
                'channels',
                'c',
                InputOption::VALUE_REQUIRED,
                'Select one or more channels for jobs for process',
                QueueInterface::MAIN_CHANNEL
            )
            ->addOption(
                'jobs-per-batch',
                '',
                InputOption::VALUE_REQUIRED,
                'Number of jobs that should be fetched and executed per single run',
                1
            );
    }
80652
static void configureLog4j() {
    org.apache.log4j.LogManager.resetConfiguration();
    org.apache.log4j.Logger.getRootLogger().addAppender(new org.apache.log4j.Appender() {
      private String name;

      @Override
      public void setName(String name) {
        this.name = name;
      }

      @Override
      public void setLayout(org.apache.log4j.Layout layout) {
      }

      @Override
      public void setErrorHandler(org.apache.log4j.spi.ErrorHandler errorHandler) {
      }

      @Override
      public boolean requiresLayout() {
        return false;
      }

      @Override
      public String getName() {
        return name;
      }

      @Override
      public org.apache.log4j.Layout getLayout() {
        return null;
      }

      @Override
      public org.apache.log4j.spi.Filter getFilter() {
        return null;
      }

      @Override
      public org.apache.log4j.spi.ErrorHandler getErrorHandler() {
        return null;
      }

      @Override
      public void doAppend(org.apache.log4j.spi.LoggingEvent event) {
        Logger logger = Logging.getLogger(event.getLoggerName());
        logger.genericLog(event.getMessage() + "", event.getThrowableInformation() == null ? null : event.getThrowableInformation().getThrowable(), convertPriority(event.getLevel()));
      }

      private Priority convertPriority(org.apache.log4j.Level level) {
        switch (level.toInt()) {
          case org.apache.log4j.Level.ALL_INT:
            return Priority.ALL;
          case org.apache.log4j.Level.TRACE_INT:
            return Priority.VERBOSE;
          case org.apache.log4j.Level.DEBUG_INT:
            return Priority.DEBUG;
          case org.apache.log4j.Level.WARN_INT:
            return Priority.WARN;
          case org.apache.log4j.Level.INFO_INT:
            return Priority.INFO;
          case org.apache.log4j.Level.ERROR_INT:
            return Priority.ERROR;
          case org.apache.log4j.Level.FATAL_INT:
            return Priority.FATAL;
        }
        return Priority.OFF;
      }

      @Override
      public void close() {
      }

      @Override
      public void clearFilters() {
      }

      @Override
      public void addFilter(org.apache.log4j.spi.Filter newFilter) {
      }
    });
  }
177717
public void configure() throws IOException {
		// Read config file
		sConfig = new Properties();
		String configFile = DEFAULT_CONFIG_FILE;
		if (System.getProperty("selenuim_config")!=null){
			configFile = System.getProperty("selenuim_config");
		}
		sConfig.load(new FileReader(configFile));

		// Prepare capabilities
		sCaps = new DesiredCapabilities();
		sCaps.setJavascriptEnabled(true);
		sCaps.setCapability("takesScreenshot", false);

		String driver = sConfig.getProperty("driver", DRIVER_PHANTOMJS);

		// Fetch PhantomJS-specific configuration parameters
		if (driver.equals(DRIVER_PHANTOMJS)) {
			// "phantomjs_exec_path"
			if (sConfig.getProperty("phantomjs_exec_path") != null) {
				sCaps.setCapability(
						PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
						sConfig.getProperty("phantomjs_exec_path"));
			} else {
				throw new IOException(
						String.format(
								"Property '%s' not set!",
								PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY));
			}
			// "phantomjs_driver_path"
			if (sConfig.getProperty("phantomjs_driver_path") != null) {
				System.out.println("Test will use an external GhostDriver");
				sCaps.setCapability(
						PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY,
						sConfig.getProperty("phantomjs_driver_path"));
			} else {
				System.out
						.println("Test will use PhantomJS internal GhostDriver");
			}
		}

		// Disable "web-security", enable all possible "ssl-protocols" and
		// "ignore-ssl-errors" for PhantomJSDriver
		// sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new
		// String[] {
		// "--web-security=false",
		// "--ssl-protocol=any",
		// "--ignore-ssl-errors=true"
		// });

		ArrayList<String> cliArgsCap = new ArrayList<String>();
		cliArgsCap.add("--web-security=false");
		cliArgsCap.add("--ssl-protocol=any");
		cliArgsCap.add("--ignore-ssl-errors=true");
		sCaps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS,
				cliArgsCap);

		// Control LogLevel for GhostDriver, via CLI arguments
		sCaps.setCapability(
				PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS,
				new String[] { "--logLevel="
						+ (sConfig.getProperty("phantomjs_driver_loglevel") != null ? sConfig
								.getProperty("phantomjs_driver_loglevel")
								: "INFO") });

		// String driver = sConfig.getProperty("driver", DRIVER_PHANTOMJS);

		// Start appropriate Driver
		if (isUrl(driver)) {
			sCaps.setBrowserName("phantomjs");
			mDriver = new RemoteWebDriver(new URL(driver), sCaps);
		} else if (driver.equals(DRIVER_FIREFOX)) {
			mDriver = new FirefoxDriver(sCaps);
		} else if (driver.equals(DRIVER_CHROME)) {
			mDriver = new ChromeDriver(sCaps);
		} else if (driver.equals(DRIVER_PHANTOMJS)) {
			mDriver = new PhantomJSDriver(sCaps);
		}
	}
1272263
public static void configure() {
        InputStream inputStream = null;
        try {
            LOG.debug("Loading esigate-vars.properties file");
            inputStream = Driver.class.getResourceAsStream("/esigate-vars.properties");
            if (inputStream == null) {
                inputStream = Driver.class.getResourceAsStream("vars.properties");
            }
            if (inputStream != null) {
                properties = new Properties();
                properties.load(inputStream);
            }
        } catch (IOException e) {
            throw new ConfigurationException(e);
        } finally {
            if (inputStream != null) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    // nothing to do
                }
            }
        }
    }