com.zaxxer.hikari.util.JavassistProxyFactory.class Maven / Gradle / Ivy
???? 4? ,com/zaxxer/hikari/util/JavassistProxyFactory java/lang/Object JavassistProxyFactory.java classPool Ljavassist/ClassPool; genDirectory Ljava/lang/String; ()V
this .Lcom/zaxxer/hikari/util/JavassistProxyFactory; main ([Ljava/lang/String;)V java/lang/Exception javassist/ClassPool
java.sql
importPackage (Ljava/lang/String;)V
javassist/LoaderClassPath java/lang/Class ! getClassLoader ()Ljava/lang/ClassLoader; # $
" % (Ljava/lang/ClassLoader;)V
'
( appendClassPath ,(Ljavassist/ClassPath;)Ljavassist/ClassPath; * +
, . [{ try { return delegate.method($$); } catch (SQLException e) { throw checkException(e); } } 0 java/sql/Connection 2 &com/zaxxer/hikari/pool/ProxyConnection 4 getName ()Ljava/lang/String; 6 7
" 8 generateProxyClass 8(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)V : ;
< java/sql/Statement > %com/zaxxer/hikari/pool/ProxyStatement @ java/sql/ResultSet B %com/zaxxer/hikari/pool/ProxyResultSet D java/sql/DatabaseMetaData F ,com/zaxxer/hikari/pool/ProxyDatabaseMetaData H d{ try { return ((cast) delegate).method($$); } catch (SQLException e) { throw checkException(e); } } J java/sql/PreparedStatement L -com/zaxxer/hikari/pool/ProxyPreparedStatement N java/sql/CallableStatement P -com/zaxxer/hikari/pool/ProxyCallableStatement R modifyProxyFactory T
U args [Ljava/lang/String;
methodBody javassist/NotFoundException Z javassist/CannotCompileException \ java/io/IOException ^ java/lang/System ` out Ljava/io/PrintStream; b c a d AGenerating method bodies for com.zaxxer.hikari.proxy.ProxyFactory f java/io/PrintStream h println j
i k
getPackage ()Ljava/lang/Package; m n
" o java/lang/Package q
r 8 #com.zaxxer.hikari.pool.ProxyFactory t
getCtClass '(Ljava/lang/String;)Ljavassist/CtClass; v w
x javassist/CtClass z
getMethods ()[Ljavassist/CtMethod; | }
{ ~ java/lang/String ? [Ljavassist/CtMethod; ? javassist/CtMethod ?
? 8 hashCode ()I ? ?
? ? getProxyConnection ? equals (Ljava/lang/Object;)Z ? ?
? ? getProxyStatement ? getProxyPreparedStatement ? getProxyCallableStatement ? getProxyResultSet ? getProxyDatabaseMetaData ? java/lang/StringBuilder ?
? {return new ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder; ? ?
? ? .HikariProxyConnection($$);} ? toString ? 7
? ? setBody ?
? ? .HikariProxyStatement($$);} ? #.HikariProxyPreparedStatement($$);} ? #.HikariProxyCallableStatement($$);} ? .HikariProxyResultSet($$);} ? ".HikariProxyDatabaseMetaData($$);} ? target/classes ? writeFile ?
{ ? method Ljavassist/CtMethod; packageName proxyCt Ljavassist/CtClass; S(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)V (.+)\.(\w+) ? $1.Hikari$2 ?
replaceAll 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; ? ?
? ? makeClass :(Ljava/lang/String;Ljavassist/CtClass;)Ljavassist/CtClass; ? ?
? javassist/Modifier ? setPublic (I)I ? ?
? ? setModifiers (I)V ? ?
{ ? Generating ? java/util/HashSet ?
?
java/util/Set ? getModifiers ? ?
? ? getSignature ? 7
? ? add ? ? ? ? getAllInterfaces "(Ljava/lang/Class;)Ljava/util/Set; ? ?
? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ()Z ? ? ? ? next ()Ljava/lang/Object; ? ? ? ? addInterface (Ljavassist/CtClass;)V ? ?
{ ? getDeclaredMethods ? }
{ ? contains ? ? javassist/CtNewMethod copy Q(Ljavassist/CtMethod;Ljavassist/CtClass;Ljavassist/ClassMap;)Ljavassist/CtMethod;
getMethod :(Ljava/lang/String;Ljava/lang/String;)Ljavassist/CtMethod;
{ isDefaultMethod ((Ljava/lang/Class;Ljavassist/CtMethod;)Z
((cast) replace D(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
? delegate super super) cast isThrowsSqlException (Ljavassist/CtMethod;)Z!"
# ? ({ return ((cast) delegate).method($$); }&
getReturnType ()Ljavassist/CtClass;()
?* voidType, ? {- return/ addMethod (Ljavassist/CtMethod;)V12
{3 getClassFile ()Ljavassist/bytecode/ClassFile;56
{7 javassist/bytecode/ClassFile9 setMajorVersion; ?
:< signature modifiedBody superMethod
intfMethod intfCt intf Ljava/lang/Class<*>; Ljava/lang/Class; primaryInterface Ljava/lang/Class; superClassName newClassName superCt targetCt superSigs #Ljava/util/Set; Ljava/util/Set; methods getExceptionTypes ()[Ljavassist/CtClass;PQ
?R [Ljavassist/CtClass;T
getSimpleNameV 7
{W SQLExceptionY clazz +(Ljava/lang/Class<*>;Ljavassist/CtMethod;)Z java/util/ArrayList]
^ getParameterTypes`Q
?a java/util/Listc toJavaClass &(Ljavassist/CtClass;)Ljava/lang/Class;ef
gd ? toArray (([Ljava/lang/Object;)[Ljava/lang/Object;jkdl [Ljava/lang/Class;n getDeclaredMethod @(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;pq
"r java/lang/reflect/Methodt
u ? default w (Ljava/lang/CharSequence;)Z y
?z pt
paramTypes &Ljava/util/List;>; Ljava/util/List; ;(Ljava/lang/Class<*>;)Ljava/util/Set;>; java/util/LinkedHashSet?
?
getInterfaces ()[Ljava/lang/Class;??
"? addAll (Ljava/util/Collection;)Z?? ??
getSuperclass ()Ljava/lang/Class;??
"? isInterface? ?
"?
interfaces %Ljava/util/Set;>; )(Ljavassist/CtClass;)Ljava/lang/Class<*>;
{ 8 []? endsWith (Ljava/lang/String;)Z??
?? %(Ljava/lang/String;)Ljava/lang/Class;e?
? java/lang/reflect/Array? newInstance &(Ljava/lang/Class;I)Ljava/lang/Object;??
?? getClass??
? cls ((Ljava/lang/String;)Ljava/lang/Class<*>; int? long? short? byte? float? double? boolean? char? void? java/lang/Integer? TYPE?E ?? java/lang/Long? ?? java/lang/Short? ?? java/lang/Byte? ?? java/lang/Float? ?? java/lang/Double? ?? java/lang/Boolean? ?? java/lang/Character? ?? java/lang/Void? ?? forName??
"? cn Code LineNumberTable LocalVariableTable
StackMapTable
Exceptions LocalVariableTypeTable Signature
SourceFile 1
? / *?
? ? )? ? ? ? |? Y? ? ? ? ? ? Y? &? )? -W*?? *2? /1L35? 9+? =?A? 9+? =CE? 9+? =GI? 9+? =KLMO? 9+? =QS? 9+? =? V? ? 0? > /
0 1 % 3 * 4 0 8 3 9 > : I ; T <