/*
@see org.hibernate.service.spi.Configurable
491107
@Override
	public void configure(Map configurationValues) {
		if ( gridDialect instanceof Configurable ) {
			( (Configurable) gridDialect ).configure( configurationValues );
		}
	}
386097
public void assignConfiguredProperties(ComponentDescriptor<?> descriptor, Object component,
            BeanConfiguration beanConfiguration) {
        AssignConfiguredCallback callback = new AssignConfiguredCallback(beanConfiguration,
                _referenceDataActivationManager);
        callback.onEvent(component, descriptor);
    }
132881
private synchronized Map<String, Map<String, Collection<Index<Node>>>> initIndexConfiguration() {
        Map<String, Map<String, Collection<Index<Node>>>> indexesByLabelAndProperty = new HashMap<>();
        try (Transaction tx = graphDatabaseService.beginTx() ) {

            final IndexManager indexManager = graphDatabaseService.index();
            for (String indexName : indexManager.nodeIndexNames()) {

                final Index<Node> index = indexManager.forNodes(indexName);
                Map<String, String> indexConfig = indexManager.getConfiguration(index);

                if (Util.toBoolean(indexConfig.get("autoUpdate"))) {
                    String labels = indexConfig.getOrDefault("labels", "");
                    for (String label : labels.split(":")) {
                        Map<String, Collection<Index<Node>>> propertyKeyToIndexMap = indexesByLabelAndProperty.computeIfAbsent(label, s -> new HashMap<>());
                        String[] keysForLabel = indexConfig.getOrDefault("keysForLabel:" + label, "").split(":");
                        for (String property : keysForLabel) {
                            propertyKeyToIndexMap.computeIfAbsent(property, s -> new ArrayList<>()).add(index);
                        }
                    }
                }
            }
            tx.success();
        }
        return indexesByLabelAndProperty;
    }
442543
protected Properties createFaxClientSpiConfiguration()
    {
        //get configuration
        Map<String,String> configuration=this.getConfiguration();
        
        //create new configuration
        Properties internalSPIConfiguration=new Properties();
        Properties overrideConfiguration=new Properties();
        
        //go over current configuration
        Iterator<Entry<String,String>> iterator=configuration.entrySet().iterator();
        Entry<String,String> entry=null;
        String key=null;
        String value=null;
        String overrideKey=null;
        String overridePrefix=FaxClientSpiConfigurationConstants.SPI_CONFIGURATION_OVERRIDE_PROPERTY_KEY_PREFIX.toString();
        int prefixLength=overridePrefix.length();
        while(iterator.hasNext())
        {
            //get next entry
            entry=iterator.next();
            
            //get key/value
            key=entry.getKey();
            value=entry.getValue();
            
            //override internal configuration
            if((key.startsWith(overridePrefix)))
            {
                if(key.length()!=prefixLength)
                {
                    overrideKey=key.substring(prefixLength);
                    
                    //put in override configuration
                    overrideConfiguration.setProperty(overrideKey,value);
                }
            }
            
            //put in new configuration
            internalSPIConfiguration.setProperty(key,value);
        }
        
        //override configuration
        internalSPIConfiguration.putAll(overrideConfiguration);
        
        return internalSPIConfiguration;
    }
404583
@Override
    protected ImmutableMap<Class<? extends QueryOptimizationProposal>, Class<? extends ProposalExecutor>>
    generateOptimizationConfigurationMap() {
        ImmutableMap.Builder<Class<? extends QueryOptimizationProposal>, Class<? extends ProposalExecutor>>
                internalExecutorMapBuilder = ImmutableMap.builder();
        internalExecutorMapBuilder.putAll(super.generateOptimizationConfigurationMap());
        internalExecutorMapBuilder.putAll(optimizationConfiguration.generateOptimizationConfigurationMap());

        return internalExecutorMapBuilder.build();
    }
636407
def SPI_config(self,config):
        ''
        self.bus.write_byte_data(self.address, 0xF0, config)
        return self.bus.read_byte_data(self.address, 0xF0)
539023
@Override
	public void configure(Configuration parameters) {

		// enforce sequential configure() calls
		synchronized (CONFIGURE_MUTEX) {
			if (this.mapreduceOutputFormat instanceof Configurable) {
				((Configurable) this.mapreduceOutputFormat).setConf(this.configuration);
			}
		}
	}
137097
private void configure(){
		addDecorator(ServiceStats.class, new ServiceStatsDecorator());
		addDecorator(ActionStats.class, new ActionStatsDecorator());
		addDecorator(ServletStats.class, new ServletStatsDecorator());
		addDecorator(FilterStats.class, new FilterStatsDecorator());
		addDecorator(CacheStats.class, new CacheStatsDecorator());
		addDecorator(StorageStats.class, new StorageStatsDecorator());
		addDecorator(MemoryStats.class, new MemoryStatsDecorator());
		addDecorator(MemoryPoolStats.class, new MemoryPoolStatsDecorator());
		addDecorator(VirtualMemoryPoolStats.class, new MemoryPoolStatsDecorator("VirtualMemoryPool"));
		addDecorator(ThreadCountStats.class, new ThreadCountDecorator());
		addDecorator(ThreadStateStats.class, new ThreadStatesDecorator());
		addDecorator(OSStats.class, new OSStatsDecorator());
		addDecorator(RuntimeStats.class, new RuntimeStatsDecorator());
		addDecorator(PageInBrowserStats.class, new PageInBrowserStatsDecorator());
		addDecorator(ErrorStats.class, new ErrorStatsDecorator());
		addDecorator(GCStats.class, new GCStatsDecorator());

		//counters
		addDecorator(CounterStats.class, new CounterStatsDecorator());
		addDecorator(MaleFemaleStats.class, new MaleFemaleStatsDecorator());
		addDecorator(GuestBasicPremiumStats.class, new GuestBasicPremiumStatsDecorator());

		//session
		addDecorator(SessionCountStats.class, new SessionCountDecorator());
	}
19586
private static void setServiceEnabled(final XMPPConnection connection,
            final boolean isEnabled) {
        ServiceDiscoveryManager manager = ServiceDiscoveryManager
                .getInstanceFor(connection);

        List<String> namespaces = new ArrayList<>();
        namespaces.addAll(Arrays.asList(NAMESPACE));
        namespaces.add(DataPacketExtension.NAMESPACE);
        if (!IBB_ONLY) {
            namespaces.add(Bytestream.NAMESPACE);
        }

        for (String namespace : namespaces) {
            if (isEnabled) {
                manager.addFeature(namespace);
            } else {
                manager.removeFeature(namespace);
            }
        }
    }
777108
@SneakyThrows
    public static ClientConfiguration buildClientConfiguration(final BaseAmazonWebServicesProperties props) {
        val cfg = new ClientConfiguration();
        cfg.setConnectionTimeout(props.getConnectionTimeout());
        cfg.setMaxConnections(props.getMaxConnections());
        cfg.setRequestTimeout(props.getRequestTimeout());
        cfg.setSocketTimeout(props.getSocketTimeout());
        cfg.setUseGzip(props.isUseGzip());
        cfg.setUseReaper(props.isUseReaper());
        cfg.setUseThrottleRetries(props.isUseThrottleRetries());
        cfg.setUseTcpKeepAlive(props.isUseTcpKeepAlive());
        cfg.setProtocol(Protocol.valueOf(props.getProtocol().toUpperCase()));
        cfg.setClientExecutionTimeout(props.getClientExecutionTimeout());
        if (props.getMaxErrorRetry() > 0) {
            cfg.setMaxErrorRetry(props.getMaxErrorRetry());
        }
        cfg.setProxyHost(props.getProxyHost());
        cfg.setProxyPassword(props.getProxyPassword());
        if (props.getProxyPort() > 0) {
            cfg.setProxyPort(props.getProxyPort());
        }
        cfg.setProxyUsername(props.getProxyUsername());
        cfg.setCacheResponseMetadata(props.isCacheResponseMetadata());

        if (StringUtils.isNotBlank(props.getLocalAddress())) {
            LOGGER.trace("Creating DynamoDb client local address [{}]", props.getLocalAddress());
            cfg.setLocalAddress(InetAddress.getByName(props.getLocalAddress()));
        }

        return cfg;
    }
937467
protected final NioSessionConfig buildSessionConfig(SelectableChannel sc,
      Queue<WriteMessage> queue) {
    final NioSessionConfig sessionConfig =
        new NioSessionConfig(sc, getHandler(), this.selectorManager, getCodecFactory(),
            getStatistics(), queue, this.dispatchMessageDispatcher, isHandleReadWriteConcurrently(),
            this.sessionTimeout, this.configuration.getSessionIdleTimeout());
    return sessionConfig;
  }
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;
		}
	}
646906
@Override
    protected void configure() {

        bind(DefaultVertxContainer.class).to(VertxContainer.class);
        bind(DefaultJerseyServer.class).to(JerseyServer.class);
        bind(DefaultJerseyHandler.class).to(JerseyHandler.class);
        bind(DefaultJerseyOptions.class).to(JerseyOptions.class).to(JerseyServerOptions.class);
        bind(VertxResponseWriterProvider.class).to(ContainerResponseWriterProvider.class);
        bind(WriteStreamBodyWriter.class).to(MessageBodyWriter.class).in(Singleton.class);

        bindFactory(VertxRequestProcessorFactory.class).to(new TypeLiteral<List<VertxRequestProcessor>>() {
        });
        bindFactory(VertxResponseProcessorFactory.class).to(new TypeLiteral<List<VertxResponseProcessor>>() {
        });
        bindFactory(VertxPostResponseProcessorFactory.class).to(new TypeLiteral<List<VertxPostResponseProcessor>>() {
        });

    }
337468
@Override
  public Element unparseServiceCreationConfiguration(final ServiceCreationConfiguration<ClusteringService> serviceCreationConfiguration) {
    Element rootElement = unparseConfig(serviceCreationConfiguration);
    return rootElement;
  }
898105
private void configure(Member.Type type, CompletableFuture<Void> future) {
    // Set a timer to retry the attempt to leave the cluster.
    configureTimeout = cluster.getContext().getThreadContext().schedule(cluster.getContext().getElectionTimeout(), () -> {
      configure(type, future);
    });

    // Attempt to leave the cluster by submitting a LeaveRequest directly to the server state.
    // Non-leader states should forward the request to the leader if there is one. Leader states
    // will log, replicate, and commit the reconfiguration.
    cluster.getContext().getServerState().reconfigure(ReconfigureRequest.builder()
      .withIndex(cluster.getConfiguration().index())
      .withTerm(cluster.getConfiguration().term())
      .withMember(new ServerMember(type, serverAddress(), clientAddress(), updated))
      .build()).whenComplete((response, error) -> {
      if (error == null) {
        if (response.status() == Response.Status.OK) {
          cancelConfigureTimer();
          cluster.configure(new Configuration(response.index(), response.term(), response.timestamp(), response.members()));
          future.complete(null);
        } else if (response.error() == null || response.error() == CopycatError.Type.NO_LEADER_ERROR) {
          cancelConfigureTimer();
          configureTimeout = cluster.getContext().getThreadContext().schedule(cluster.getContext().getElectionTimeout().multipliedBy(2), () -> configure(type, future));
        } else {
          cancelConfigureTimer();
          future.completeExceptionally(response.error().createException());
        }
      }
    });
  }
261252
public static void configureExample(String host, int port, String user, String password, Authentication authType)
    throws IOException, ResourceNotFoundException, ForbiddenUserException, FailedRequestException, ResourceNotResendableException
  {
    // create the client
    DatabaseClient client = DatabaseClientFactory.newClient(host, port, user, password, authType);

    installResourceExtension(client);

    configureQueryOptions(client);

    setUpExample(client);

    // release the client
    client.release();
  }
384076
@Override
    public void configure()
    {
        log.info("Loading Metadata from persistence.xml ...");

        ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();

        try
        {
            Map<String, PersistenceUnitMetadata> metadatas = findPersistenceMetadatas();
            for (String persistenceUnit : persistenceUnits)
            {
                if (!metadatas.containsKey(persistenceUnit))
                {
                    log.error("Unconfigured persistence unit: " + persistenceUnit
                            + " please validate with persistence.xml");
                    throw new PersistenceUnitConfigurationException("Invalid persistence unit: " + persistenceUnit
                            + " provided");
                }
            }
            log.info("Finishing persistence unit metadata configuration ...");
            appMetadata.addPersistenceUnitMetadata(metadatas);
        }
        catch (InvalidConfigurationException icex)
        {
            log.error("Error occurred during persistence unit configuration, Caused by: .", icex);
            throw new PersistenceLoaderException(icex);
        }
    }