/** * Get a {@link BasicDataSource} based on the config * @param config configuration * @param broker broker * @return a {@link BasicDataSource} * @throws IOException */ public static <S extends ScopeType<S>> BasicDataSource get(Config config, SharedResourcesBroker<S> broker) throws IOException { try { return broker.getSharedResource(new MysqlDataSourceFactory<S>(), new MysqlDataSourceKey(MysqlStateStore.getDataSourceId(config), config)); } catch (NotConfiguredException nce) { throw new IOException(nce); } }
/** * Get a {@link BasicDataSource} based on the config * @param config configuration * @param broker broker * @return a {@link BasicDataSource} * @throws IOException */ public static <S extends ScopeType<S>> BasicDataSource get(Config config, SharedResourcesBroker<S> broker) throws IOException { try { return broker.getSharedResource(new MysqlDataSourceFactory<S>(), new MysqlDataSourceKey(MysqlStateStore.getDataSourceId(config), config)); } catch (NotConfiguredException nce) { throw new IOException(nce); } }