public ClientConnectionFactoryWrapper getManagedDataSource(Map configMap,
      List<ConfigProperty> props) throws DataSourceCreateException {
    Object cf = null;
    ManagedConnectionFactory mcf = null;
    ConfiguredDataSourceProperties configs = createDataSourceProperties(configMap);
    if (configs.getMCFClass() == null) {
      logger.error(
          "DataSourceFactory::getManagedDataSource:Managed Connection factory class is not available");
      throw new DataSourceCreateException(
          "DataSourceFactory::getManagedDataSource:Managed Connection factory class is not available");
    } else {
      try {
        Class cl = ClassPathLoader.getLatest().forName(configs.getMCFClass());
        mcf = (ManagedConnectionFactory) cl.newInstance();
        invokeAllMethods(cl, mcf, props);
      } catch (Exception ex) {
        logger.error(String.format(
            "DataSourceFactory::getManagedDataSource: Exception in creating managed connection factory. Exception string, %s",
            ex));
        throw new DataSourceCreateException(
            String.format(
                "DataSourceFactory::getManagedDataSource: Exception in creating managed connection factory. Exception string, %s",
                ex));
      }
    }
    // Initialize the managed connection factory class
    // Instantiate a connection manager with the managed-conn-facory-class
    // and generate a connection pool.
    Object cm = null;
    if (configs.getMCFClass().equals("org.apache.persistence.connection.internal.ConnFactory")) {
      cm = new FacetsJCAConnectionManagerImpl(mcf, configs);
    } else {
      cm = new JCAConnectionManagerImpl(mcf, configs);
    }
    try {
      cf = mcf.createConnectionFactory((ConnectionManager) cm);
    } catch (Exception ex) {
      logger.error(
          "DataSourceFactory::getManagedDataSource: Exception in creating managed connection factory. Exception string:{}",
          ex.toString());
      throw new DataSourceCreateException(
          String.format(
              "DataSourceFactory::getManagedDataSource: Exception in creating managed connection factory. Exception string, %s",
              ex));
    }
    return new ClientConnectionFactoryWrapper(cf, cm);
  }
This function creates a data source from the ManagedConnectionFactory class using the
connectionManager.

@return javax.sql.DataSource
geode-core/src/main/java/org/apache/geode/internal/datasource/DataSourceFactory.java