Get data source map.

@param dataSourceConfigurationMap data source configuration map
@return data source map
778457
public static Map<String, DataSource> getDataSourceMap(final Map<String, DataSourceConfiguration> dataSourceConfigurationMap) {
        Map<String, DataSource> result = new LinkedHashMap<>(dataSourceConfigurationMap.size(), 1);
        for (Entry<String, DataSourceConfiguration> entry : dataSourceConfigurationMap.entrySet()) {
            result.put(entry.getKey(), entry.getValue().createDataSource());
        }
        return result;
    }
1207219
public void setDataSource(DataSource dataSource) {
        mDataSource = dataSource;
        mDriverClassName = null;
        mURL = null;
        mUsername = null;
        mPassword = null;
    }
200077
@Override
    public final DataSource getJtaDataSource() {
        if (ivJtaDataSource == null || ivJtaDataSource instanceof GenericDataSource) { // d455055
            ivJtaDataSource = getJPADataSource(ivJtaDataSourceJNDIName);
        }
        return ivJtaDataSource;
    }
173066
@JsonCreator
    public static Datasource datasource(final String ds) {
        int colonPos = ds.indexOf(":");
        int slashPos = ds.indexOf("/");

        String nodeAndPort = ds;
        String node;
        int port = -1;
        String resource = "";

        if (slashPos != -1) {
            nodeAndPort = ds.substring(0, slashPos);
            resource = ds.substring(slashPos+1);
        }
        if (colonPos != -1) {
            node = nodeAndPort.substring(0, colonPos);
            port = valueOf(nodeAndPort.substring(colonPos+1));
            return datasource(node, port, resource);
        } else {
            return datasource(nodeAndPort, -1, resource);
        }
    }
1325673
private DataSource getDataSource(ComponentHelper cmp, Resource resource) {
    try {
      /*
       * by default the path is read from request "path" parameter
       * here we overwrite it via a synthetic resource because the path may be overwritten by validation logic
       * to ensure the path is not beyond the configured root path
       */
      ValueMap overwriteProperties = new ValueMapDecorator(ImmutableMap.<String, Object>of("path", resource.getPath()));
      Resource dataSourceResourceWrapper = GraniteUiSyntheticResource.wrapMerge(request.getResource(), overwriteProperties);
      return cmp.getItemDataSource(dataSourceResourceWrapper);
    }
    catch (ServletException | IOException ex) {
      throw new RuntimeException("Unable to get data source.", ex);
    }
  }
234122
@SuppressWarnings("nls")
    protected DataSource datasourceFromConfig(JdbcOptionsBean config) {
        Properties props = new Properties();
        props.putAll(config.getDsProperties());
        setConfigProperty(props, "jdbcUrl", config.getJdbcUrl());
        setConfigProperty(props, "username", config.getUsername());
        setConfigProperty(props, "password", config.getPassword());

        setConfigProperty(props, "connectionTimeout", config.getConnectionTimeout());
        setConfigProperty(props, "idleTimeout", config.getIdleTimeout());
        setConfigProperty(props, "maxPoolSize", config.getMaximumPoolSize());
        setConfigProperty(props, "maxLifetime", config.getMaxLifetime());
        setConfigProperty(props, "minIdle", config.getMinimumIdle());
        setConfigProperty(props, "poolName", config.getPoolName());
        setConfigProperty(props, "autoCommit", config.isAutoCommit());

        HikariConfig hikariConfig = new HikariConfig(props);
        return new HikariDataSource(hikariConfig);
    }
952477
public static DataSourcePropertyProvider getProvider(final DataSource dataSource) {
        String dataSourceClassName = dataSource.getClass().getName();
        return DATA_SOURCE_PROPERTY_PROVIDERS.containsKey(dataSourceClassName) ? DATA_SOURCE_PROPERTY_PROVIDERS.get(dataSourceClassName) : new DefaultDataSourcePropertyProvider();
    }
295938
private static DataSource getNewDataSource(final String dataSourceName) {
		try {
			Context context = new InitialContext();
			return (DataSource) context.lookup(dataSourceName);
		} catch (NamingException ex) {
			throw new UroborosqlRuntimeException("DataSource[" + dataSourceName + "] can not be acquired.", ex);
		}
	}
706587
@Override
    public final DataSource getNonJtaDataSource() {
        if (ivNonJtaDataSource == null || ivNonJtaDataSource instanceof GenericDataSource) { // d455055
            ivNonJtaDataSource = getJPADataSource(ivNonJtaDataSourceJNDIName);
        }
        return ivNonJtaDataSource;
    }
931265
public static DataSourceConfiguration getDataSourceConfiguration(final DataSource dataSource) {
        DataSourceConfiguration result = new DataSourceConfiguration(dataSource.getClass().getName());
        result.getProperties().putAll(findAllGetterProperties(dataSource));
        return result;
    }
1261281
public function getFieldsWithSameDataSource($mappedFieldNameRef)
    {
        if (! isset($this->dataSources[$mappedFieldNameRef])) {
            throw new ObjectMappingException(sprintf('A "data source" metadata is expected for the field "%s".', $mappedFieldNameRef));
        }

        $id = $this->dataSources[$mappedFieldNameRef]->getId();
        $method = $this->dataSources[$mappedFieldNameRef]->getMethod();

        $propLoadedTogether = [];
        foreach ($this->dataSources as $mappedFieldName => $value) {

            if (
                $mappedFieldName !== $mappedFieldNameRef 
                && 
                ((null === $id && $value->getMethod()->isEquals($method)) || $id === $value->getId())
            ) {
                $propLoadedTogether[] = $mappedFieldName;
            }
        }

        return $propLoadedTogether;
    }
382214
private <T extends DataSource> T applyDataSourceProperties(T dataSource) {
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            String key = entry.getKey().toString();
            String value = entry.getValue().toString();

            String propertyKey = PropertyKey.DATA_SOURCE_PROPERTY.getKey();
            if (key.startsWith(propertyKey)) {
                String dataSourceProperty = key.substring(propertyKey.length());
                ReflectionUtils.invokeSetter(dataSource, dataSourceProperty, value);
            }
        }
        return dataSource;
    }
908081
@Bean
  public DataSource dataSource() {
    DriverManagerDataSource dataSource = new DriverManagerDataSource(dbUrl, userName, password);
    dataSource.setDriverClassName(Driver.class.getName());

    // no need shutdown, EmbeddedDatabaseFactoryBean will take care of this
    // EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
    // EmbeddedDatabase dataSource = builder.setType(EmbeddedDatabaseType.H2).setName("h2_example").build();
    return dataSource;
  }
37376
@Bean
    public DataSource dataSource() throws SQLException {
        Preconditions.checkState(isValidConfiguration(), "The orchestration configuration is invalid, please choose one from Sharding rule and Master-slave rule.");
        return isShardingRule() ? createShardingDataSource() : createMasterSlaveDataSource();
    }
107858
@Deprecated
  public static DatasetDescriptor fromDataMap(Map<String, String> dataMap) {
    DatasetDescriptor descriptor = new DatasetDescriptor(dataMap.get(PLATFORM_KEY), dataMap.get(NAME_KEY));
    dataMap.forEach((key, value) -> {
      if (!key.equals(PLATFORM_KEY) && !key.equals(NAME_KEY)) {
        descriptor.addMetadata(key, value);
      }
    });
    return descriptor;
  }
976520
public String generateSourceMap() throws IOException {
		final String sourceMethod = "generateSourceMap"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod, new Object[]{name});
		}
		String result = null;
		lineLengths = getLineLengths();
		Compiler compiler = new Compiler();
		sgen = new SourceMapGeneratorV3();
		compiler.initOptions(compiler_options);
		currentLine = currentChar = 0;
		Node node = compiler.parse(JSSourceFile.fromCode(name, source));
		if (compiler.hasErrors()) {
			if (log.isLoggable(Level.WARNING)) {
				JSError[] errors = compiler.getErrors();
				for (JSError error : errors) {
					log.logp(Level.WARNING, sourceClass, sourceMethod, error.toString());
				}
			}
		}
		if (node != null) {
			processNode(node);
			StringWriter writer = new StringWriter();
			sgen.appendTo(writer, name);
			result = writer.toString();
		}
		sgen = null;
		lineLengths = null;
		if (isTraceLogging) {
			log.exiting(sourceClass, sourceMethod, result);
		}
		return result;
	}
358451
@Override
    public DataSource getSelectedDataSource() {
        final String dataSourceName = selectableDataSourceHolder.getCurrentSelectableDataSourceKey();
        if (dataSourceName != null) {
            return selectableDataSourceHolder.getSelectedDataSource();
        } else { // means no name set on thread local
            try {
                selectableDataSourceHolder.switchSelectableDataSourceKey(SlaveDBAccessor.MASTER_DB); // as default
                return selectableDataSourceHolder.getSelectedDataSource();
            } finally {
                selectableDataSourceHolder.switchSelectableDataSourceKey(null); // restore
            }
        }
    }