com.jeeplus.database.datasource.DynamicRoutingDataSource.class Maven / Gradle / Ivy
???? 4R 8com/jeeplus/database/datasource/DynamicRoutingDataSource 9com/jeeplus/database/datasource/AbstractRoutingDataSource 2org/springframework/beans/factory/InitializingBean 0org/springframework/beans/factory/DisposableBean db java/util/Map$Entry
java/util/Map Entry G Lorg/slf4j/Logger; D Ljava/lang/Class; XLjava/lang/Class<+Lcom/jeeplus/database/datasource/strategy/DynamicDataSourceStrategy;>; I Ljava/util/Map; 9Ljava/util/Map; E Z g .Lorg/apache/ibatis/mapping/DatabaseIdProvider; H Ljava/lang/String; _ F DLcom/jeeplus/database/datasource/provider/DynamicDataSourceProvider; L [Ljava/util/Map;
ALLATORIxDEMO setStrategy (Ljava/lang/Class;)V [(Ljava/lang/Class<+Lcom/jeeplus/database/datasource/strategy/DynamicDataSourceStrategy;>;)V ' a :Lcom/jeeplus/database/datasource/DynamicRoutingDataSource; setP6spy (Z)V java/lang/Exception - "IG[ZCYS[OMDZ%1KK&E??XO / 1com/jeeplus/modules/database/datalink/jdbc/DBPool 1 &(Ljava/lang/String;)Ljava/lang/String; # 3
2 4 java/lang/Class 6 forName %(Ljava/lang/String;)Ljava/lang/Class; 8 9
7 : < *务恴敹挛溙X棉派刹布弉呚亏?y > Lcom/jeeplus/database/datasource/spring/boot/autoconfigure/DataSourceProperty @
A 4 org/slf4j/Logger C info (Ljava/lang/String;)V E F D G I >奯敚挛溺呚劂嘝弪呚京Z佬布最彠兏皍兙俨赼 K warn M F D N java/lang/Throwable P ()V org/slf4j/LoggerFactory T getLogger %(Ljava/lang/Class;)Lorg/slf4j/Logger; V W
U X setDatabaseIdProvider 1(Lorg/apache/ibatis/mapping/DatabaseIdProvider;)V \
getDataSource *(Ljava/lang/String;)Ljavax/sql/DataSource; $org/springframework/util/StringUtils ` isEmpty (Ljava/lang/Object;)Z b c
a d ()Ljavax/sql/DataSource; # f
g ! i ()Z b k
l containsKey n c
o %亻)tU绍攅捧滥两辡囗攅捧滥 q debug '(Ljava/lang/String;Ljava/lang/Object;)V s t D u get &(Ljava/lang/Object;)Ljava/lang/Object; w x
y 6com/jeeplus/database/datasource/DynamicGroupDataSource { determineDataSource } f
| ~ ? %令UQ
匠敚挛溺乘迾嚫敚挛溺 ? javax/sql/DataSource ? java/lang/String ?
addDataSource +(Ljava/lang/String;Ljavax/sql/DataSource;)V !com/p6spy/engine/spy/P6DataSource ? (Ljavax/sql/DataSource;)V ? ?
? ? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; ? ?
? contains (Ljava/lang/CharSequence;)Z ? ?
? ? split '(Ljava/lang/String;)[Ljava/lang/String; ? ?
? ?
addDatasource ? ?
| ? newInstance ()Ljava/lang/Object; ? ?
7 ? Bcom/jeeplus/database/datasource/strategy/DynamicDataSourceStrategy ? Y(Ljava/lang/String;Lcom/jeeplus/database/datasource/strategy/DynamicDataSourceStrategy;)V ? ?
| ? 涎助攅捧滥夸赐 ? error *(Ljava/lang/String;Ljava/lang/Throwable;)V ? ? D ? remove ? x
? 勝怫攅捄滥動轗UQ
扥劵 ? E t D ? Ljavax/sql/DataSource; java/lang/Object ? destroy #jf`nUmgdj1hhf??{lU)g'['[ ? entrySet ()Ljava/util/Set; ? ?
?
java/util/Set ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ? k ? ? next ? ? ? ? getValue ? ? ? getClass ()Ljava/lang/Class; ? ?
? ? IEO ? getDeclaredMethod @(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method; ? ?
7 ? java/lang/reflect/Method ? invoke 9(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; ? ?
? ? java/sql/SQLException ? Fcom/jeeplus/database/datasource/toolkit/DynamicDataSourceContextHolder ? peek ()Ljava/lang/String; ? ?
? ? ^ _
? ,org/apache/ibatis/mapping/DatabaseIdProvider ?
getDatabaseId *(Ljavax/sql/DataSource;)Ljava/lang/String; ? ? ? ? $org/apache/ibatis/session/SqlSession ? 9com/jeeplus/modules/database/config/DsSpringContextHolder ? getBean %(Ljava/lang/Class;)Ljava/lang/Object; ? ?
? ? getConfiguration +()Lorg/apache/ibatis/session/Configuration; ? ? ? ? 'org/apache/ibatis/session/Configuration ?
setDatabaseId ? F
? ? printStackTrace S
? getCurrentGroupDataSources ()Ljava/util/Map; ]()Ljava/util/Map; setProvider G(Lcom/jeeplus/database/datasource/provider/DynamicDataSourceProvider;)V afterPropertiesSet Bcom/jeeplus/database/datasource/provider/DynamicDataSourceProvider loadDataSources
剨姂億助輈)tU丣攅捧滥 size ()I
java/lang/Integer valueOf (I)Ljava/lang/Integer;
getKey ? ? ?
# " Q役券皮麭讎攅捄滥昅纱敚挛溺Y绮呸丐UQ
ケ兜乾朣UQ
也敚挛溺$
| 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V E' D( <彚券皍麭训攅捧滥昦匠敹挛溙ケ敹挛溙呸丳Ur* java/lang/RuntimeException, %话梵柏XGX黲译敚挛庹诋罄. ? F
-0
setPrimary ? S
3 java/util/LinkedHashMap5
63 &java/util/concurrent/ConcurrentHashMap8
93 !亻黑译敹挛溙乘违嚫敹挛; s F D= getCurrentDataSources ;()Ljava/util/Map; removeDataSource removeDatasourceB ?
|C 勝怫攅捄滥剕陎UQ
扥劵E &务恴敹挛溙X朣戋刹Ur)攅捧滥G Signature
ConstantValue Code LineNumberTable LocalVariableTable
StackMapTable
Exceptions InnerClasses
SourceFile ! I I J ! I " # $ % K : *+? (? L ;M ) * ) I &