/** * Create a new LazyConnectionDataSourceProxy. * @param targetDataSource the target DataSource */ public LazyConnectionDataSourceProxy(DataSource targetDataSource) { setTargetDataSource(targetDataSource); afterPropertiesSet(); }
/** * Create a new LazyConnectionDataSourceProxy. * @param targetDataSource the target DataSource */ public LazyConnectionDataSourceProxy(DataSource targetDataSource) { setTargetDataSource(targetDataSource); afterPropertiesSet(); }
/** * Create a new LazyConnectionDataSourceProxy. * @param targetDataSource the target DataSource */ public LazyConnectionDataSourceProxy(DataSource targetDataSource) { setTargetDataSource(targetDataSource); afterPropertiesSet(); }
@Override public void afterPropertiesSet() throws Exception { if (this.shardsDataSources == null) { throw new IllegalArgumentException("Property 'shardsDataSources' is required"); } this.resolvedShardsDataSources = new HashMap<Object, DataSource>(this.shardsDataSources.size()); for (Map.Entry<Object, Object> entry : this.shardsDataSources.entrySet()) { DataSource dataSource = resolveSpecifiedDataSource(entry.getValue()); LazyConnectionDataSourceProxy lazyDataSourceProxy = new LazyConnectionDataSourceProxy(); lazyDataSourceProxy.setTargetDataSource(dataSource); this.resolvedShardsDataSources.put(entry.getKey(), lazyDataSourceProxy); } if (this.defaultDataSource == null) { throw new IllegalArgumentException("Property 'defaultDataSource' is required"); } if(this.defaultDataSource != null){ resolvedDefaultDataSource = this.resolveSpecifiedDataSource(defaultDataSource); } }