
org.springframework.jdbc.datasource.lookup.RoutingDataSource Maven / Gradle / Ivy
package org.springframework.jdbc.datasource.lookup;
import java.lang.reflect.Constructor;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import javax.sql.DataSource;
import org.springframework.beans.BeanUtils;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
/**
*
* PropertiesConfigurationFactory propertiesConfigurationFactory = new PropertiesConfigurationFactory(DataSourceProperties.class);
* propertiesConfigurationFactory.setPropertySources(new PropertySourcesBinder(new ResourcePropertySource(resource)).getPropertySources());
* DataSource dataSource = propertiesConfigurationFactory.getObject().initializeDataSourceBuilder().build();
*
*
* @see net.ttddyy.dsproxy.listener.AbstractQueryLoggingListener
* @see net.ttddyy.dsproxy.listener.CommonsQueryLoggingListener
* @see net.ttddyy.dsproxy.listener.SLF4JQueryLoggingListener
* @see net.ttddyy.dsproxy.listener.SLF4JQueryLoggingListener
* @see org.springframework.beans.BeanUtils#instantiate(Class)
* @see org.springframework.util.ReflectionUtils#findMethod(Class, String)
* @see org.springframework.util.ReflectionUtils#invokeMethod(java.lang.reflect.Method,
* Object, Object...)
* @see org.springframework.core.Constants#asString(String)
*/
public final class RoutingDataSource extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource {
private final MultiValueMap readOnly = CollectionUtils.toMultiValueMap(new HashMap>());
private Class extends DataSource> proxy;
private final int size;
/**
* @see java.util.Collections#addAll(Collection, Object...)
* @see java.util.Collections#synchronizedList(List)
* @see org.springframework.core.io.ContextResource#getPathWithinContext()
*/
public RoutingDataSource(Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy