java cglib_CGlib简单介绍

2022-08-30 20:24:45 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

//Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.//Jad home page:http://www.geocities.com/kpdus/jad.html//Decompiler options: packimports(3)//Source File Name: packagecn.eulic.codelab.cglib;importjava.lang.reflect.Method;importnet.sf.cglib.core.Signature;importnet.sf.cglib.proxy.*;//Referenced classes of package cn.eulic.codelab.cglib://InfoManagerpublicclassCGLIB.BIND_CALLBACKSextendsInfoManagerimplementsFactory

{staticvoidCGLIB$STATICHOOK1()

{

Class class1;

ClassLoader classloader;

CGLIB$THREAD_CALLBACKS=newThreadLocal();

classloader=(class1=Class.forName(“cn.eulic.codelab.cglib.InfoManager

EnhancerByCGLIB

de624598”)).getClassLoader();

classloader;

CGLIB$emptyArgs=newObject[0];

CGLIBdelete0Proxy=MethodProxy.create(classloader, (CGLIBdelete0Method=Class.forName(“cn.eulic.codelab.cglib.InfoManager”).getDeclaredMethod(“delete”,newClass[0])).getDeclaringClass(), class1,”()V”,”delete”,”CGLIBdelete0″);

CGLIBcreate1Proxy=MethodProxy.create(classloader, (CGLIBcreate1Method=Class.forName(“cn.eulic.codelab.cglib.InfoManager”).getDeclaredMethod(“create”,newClass[0])).getDeclaringClass(), class1,”()V”,”create”,”CGLIBcreate1″);

CGLIBquery2Proxy=MethodProxy.create(classloader, (CGLIBquery2Method=Class.forName(“cn.eulic.codelab.cglib.InfoManager”).getDeclaredMethod(“query”,newClass[0])).getDeclaringClass(), class1,”()V”,”query”,”CGLIBquery2″);

CGLIBupdate3Proxy=MethodProxy.create(classloader, (CGLIBupdate3Method=Class.forName(“cn.eulic.codelab.cglib.InfoManager”).getDeclaredMethod(“update”,newClass[0])).getDeclaringClass(), class1,”()V”,”update”,”CGLIBupdate3″);

CGLIBfinalize4Proxy=MethodProxy.create(classloader, (CGLIBfinalize4Method=Class.forName(“java.lang.Object”).getDeclaredMethod(“finalize”,newClass[0])).getDeclaringClass(), class1,”()V”,”finalize”,”CGLIBfinalize4″);

CGLIBhashCode5Proxy=MethodProxy.create(classloader, (CGLIBhashCode5Method=Class.forName(“java.lang.Object”).getDeclaredMethod(“hashCode”,newClass[0])).getDeclaringClass(), class1,”()I”,”hashCode”,”CGLIBhashCode5″);

CGLIBclone6Proxy=MethodProxy.create(classloader, (CGLIBclone6Method=Class.forName(“java.lang.Object”).getDeclaredMethod(“clone”,newClass[0])).getDeclaringClass(), class1,”()Ljava/lang/Object;”,”clone”,”CGLIBclone6″);

CGLIBequals7Proxy=MethodProxy.create(classloader, (CGLIBequals7Method=Class.forName(“java.lang.Object”).getDeclaredMethod(“equals”,newClass[] {

Class.forName(“java.lang.Object”)

})).getDeclaringClass(), class1,”(Ljava/lang/Object;)Z”,”equals”,”CGLIBequals7″);

CGLIBtoString8Proxy=MethodProxy.create(classloader, (CGLIBtoString8Method=Class.forName(“java.lang.Object”).getDeclaredMethod(“toString”,newClass[0])).getDeclaringClass(), class1,”()Ljava/lang/String;”,”toString”,”CGLIBtoString8″);return;

}finalvoidCGLIBdelete0()

{super.delete();

}publicfinalvoiddelete()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:breakMISSING_BLOCK_LABEL_21;

_L4:breakMISSING_BLOCK_LABEL_37;this;

CGLIBdelete0

CGLIB$emptyArgs;

CGLIBdelete0

intercept();return;super.delete();return;

}finalvoidCGLIBcreate1()

{super.create();

}publicfinalvoidcreate()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:breakMISSING_BLOCK_LABEL_21;

_L4:breakMISSING_BLOCK_LABEL_37;this;

CGLIBcreate1

CGLIB$emptyArgs;

CGLIBcreate1

intercept();return;super.create();return;

}finalvoidCGLIBquery2()

{super.query();

}publicfinalvoidquery()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:breakMISSING_BLOCK_LABEL_21;

_L4:breakMISSING_BLOCK_LABEL_37;this;

CGLIBquery2

CGLIB$emptyArgs;

CGLIBquery2

intercept();return;super.query();return;

}finalvoidCGLIBupdate3()

{super.update();

}publicfinalvoidupdate()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:breakMISSING_BLOCK_LABEL_21;

_L4:breakMISSING_BLOCK_LABEL_37;this;

CGLIBupdate3

CGLIB$emptyArgs;

CGLIBupdate3

intercept();return;super.update();return;

}finalvoidCGLIBfinalize4()throwsThrowable

{super.finalize();

}protectedfinalvoidfinalize()throwsThrowable

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:breakMISSING_BLOCK_LABEL_21;

_L4:breakMISSING_BLOCK_LABEL_37;this;

CGLIBfinalize4

CGLIB$emptyArgs;

CGLIBfinalize4

intercept();return;super.finalize();return;

}finalintCGLIBhashCode5()

{returnsuper.hashCode();

}publicfinalinthashCode()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull52;goto_L3 _L4

_L3:this;

CGLIBhashCode5

CGLIB$emptyArgs;

CGLIBhashCode5

intercept();

JVM INSTR dup ;

JVM INSTR ifnonnull45;goto_L5 _L6

_L5:

JVM INSTR pop ;0;goto_L7

_L6:

(Number);

intValue();

_L7:return;

_L4:returnsuper.hashCode();

}finalObject CGLIBclone6()throwsCloneNotSupportedException

{returnsuper.clone();

}protectedfinalObject clone()throwsCloneNotSupportedException

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull37;goto_L3 _L4

_L3:this;

CGLIBclone6

CGLIB$emptyArgs;

CGLIBclone6

intercept();return;

_L4:returnsuper.clone();

}finalbooleanCGLIBequals7(Object obj)

{returnsuper.equals(obj);

}publicfinalbooleanequals(Object obj)

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull57;goto_L3 _L4

_L3:this;

CGLIBequals7

obj

};

CGLIBequals7

intercept();

JVM INSTR dup ;

JVM INSTR ifnonnull50;goto_L5 _L6

_L5:

JVM INSTR pop ;false;goto_L7

_L6:

(Boolean);

booleanValue();

_L7:return;

_L4:returnsuper.equals(obj);

}finalString CGLIBtoString8()

{returnsuper.toString();

}publicfinalString toString()

{

CGLIBCALLBACK_0;if(CGLIBCALLBACK_0!=null)goto_L2;elsegoto_L1

_L1:

JVM INSTR pop ;

CGLIB$BIND_CALLBACKS(this);

CGLIB$CALLBACK_0;

_L2:

JVM INSTR dup ;

JVM INSTR ifnull40;goto_L3 _L4

_L3:this;

CGLIBtoString8

CGLIB$emptyArgs;

CGLIBtoString8

intercept();

(String);return;

_L4:returnsuper.toString();

}publicstaticMethodProxy CGLIB$findMethodProxy(Signature signature)

{

String s=signature.toString();

s;

s.hashCode();

JVM INSTR lookupswitch9:default200//-1949253108: 92//-1574182249: 104//-1166709331: 116//-508378822: 128//-358764054: 140//598313209: 152//1826985398: 164//1913648695: 176//1984935277: 188;goto_L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8 _L9 _L10

_L2:”update()V”;

equals();

JVM INSTR ifeq201;goto_L11 _L12

_L12:breakMISSING_BLOCK_LABEL_201;

_L11:returnCGLIBupdate3

_L3:”finalize()V”;

equals();

JVM INSTR ifeq201;goto_L13 _L14

_L14:breakMISSING_BLOCK_LABEL_201;

_L13:returnCGLIBfinalize4

_L4:”query()V”;

equals();

JVM INSTR ifeq201;goto_L15 _L16

_L16:breakMISSING_BLOCK_LABEL_201;

_L15:returnCGLIBquery2

_L5:”clone()Ljava/lang/Object;”;

equals();

JVM INSTR ifeq201;goto_L17 _L18

_L18:breakMISSING_BLOCK_LABEL_201;

_L17:returnCGLIBclone6

_L6:”delete()V”;

equals();

JVM INSTR ifeq201;goto_L19 _L20

_L20:breakMISSING_BLOCK_LABEL_201;

_L19:returnCGLIBdelete0

_L7:”create()V”;

equals();

JVM INSTR ifeq201;goto_L21 _L22

_L22:breakMISSING_BLOCK_LABEL_201;

_L21:returnCGLIBcreate1

_L8:”equals(Ljava/lang/Object;)Z”;

equals();

JVM INSTR ifeq201;goto_L23 _L24

_L24:breakMISSING_BLOCK_LABEL_201;

_L23:returnCGLIBequals7

_L9:”toString()Ljava/lang/String;”;

equals();

JVM INSTR ifeq201;goto_L25 _L26

_L26:breakMISSING_BLOCK_LABEL_201;

_L25:returnCGLIBtoString8

_L10:”hashCode()I”;

equals();

JVM INSTR ifeq201;goto_L27 _L28

_L28:breakMISSING_BLOCK_LABEL_201;

_L27:returnCGLIBhashCode5

_L1:

JVM INSTR pop ;returnnull;

}publicstaticvoidCGLIB$SET_THREAD_CALLBACKS(Callback acallback[])

{

CGLIB$THREAD_CALLBACKS.set(acallback);

}publicstaticvoidCGLIB$SET_STATIC_CALLBACKS(Callback acallback[])

{

CGLIB$STATIC_CALLBACKS=acallback;

}privatestaticfinalvoidCGLIB$BIND_CALLBACKS(Object obj)

{

CGLIB.STATIC_CALLBACKS static_callbacks=(CGLIB.STATIC_CALLBACKS)obj;if(static_callbacks.CGLIB$BOUND)goto_L2;elsegoto_L1

_L1:

Object obj1;

static_callbacks.CGLIB$BOUND=true;

obj1=CGLIB$THREAD_CALLBACKS.get();

obj1;if(obj1!=null)goto_L4;elsegoto_L3

_L3:

JVM INSTR pop ;

CGLIBSTATIC_CALLBACKS;if(CGLIBSTATIC_CALLBACKS!=null)goto_L4;elsegoto_L5

_L5:

JVM INSTR pop ;goto_L2

_L4:

(Callback[]);

static_callbacks;

JVM INSTR swap ;0;

JVM INSTR aaload ;

(MethodInterceptor);

CGLIB$CALLBACK_0;

_L2:

}publicObject newInstance(Callback acallback[])

{

CGLIB$SET_THREAD_CALLBACKS(acallback);

CGLIB$SET_THREAD_CALLBACKS(null);returnnew();

}publicObject newInstance(Callback callback)

{

CGLIB$SET_THREAD_CALLBACKS(newCallback[] {

callback

});

CGLIB$SET_THREAD_CALLBACKS(null);returnnew();

}publicObject newInstance(Class aclass[], Object aobj[], Callback acallback[])

{

CGLIB$SET_THREAD_CALLBACKS(acallback);

JVM INSTRnew#2;

JVM INSTR dup ;

aclass;

aclass.length;

JVM INSTR tableswitch00:default35//0 28;goto_L1 _L2

_L2:

JVM INSTR pop ;();goto_L3

_L1:

JVM INSTR pop ;thrownewIllegalArgumentException(“Constructor not found”);

_L3:

CGLIB$SET_THREAD_CALLBACKS(null);return;

}publicCallback getCallback(inti)

{

CGLIB$BIND_CALLBACKS(this);this;

i;

JVM INSTR tableswitch00:default30//0 24;goto_L1 _L2

_L2:

CGLIB$CALLBACK_0;goto_L3

_L1:

JVM INSTR pop ;null;

_L3:return;

}publicvoidsetCallback(inti, Callback callback)

{this;

callback;

i;

JVM INSTR tableswitch00:default29//0 20;goto_L1 _L2

_L2:

(MethodInterceptor);

CGLIB$CALLBACK_0;goto_L3

_L1:

JVM INSTR pop2 ;

_L3:

}publicCallback[] getCallbacks()

{

CGLIB$BIND_CALLBACKS(this);this;return(newCallback[] {

CGLIB$CALLBACK_0

});

}publicvoidsetCallbacks(Callback acallback[])

{this;

acallback;

JVM INSTR dup2 ;0;

JVM INSTR aaload ;

(MethodInterceptor);

CGLIB$CALLBACK_0;

}privatebooleanCGLIBBOUND;privatestaticfinalThreadLocal CGLIBTHREAD_CALLBACKS;privatestaticfinalCallback CGLIBSTATIC_CALLBACKS[];privateMethodInterceptor CGLIBCALLBACK_0;privatestaticfinalMethod CGLIBdelete0Method;privatestaticfinalMethodProxy CGLIBdelete0Proxy;privatestaticfinalObject CGLIBemptyArgs[];privatestaticfinalMethod CGLIBcreate1Method;privatestaticfinalMethodProxy CGLIBcreate1Proxy;privatestaticfinalMethod CGLIBquery2Method;privatestaticfinalMethodProxy CGLIBquery2Proxy;privatestaticfinalMethod CGLIBupdate3Method;privatestaticfinalMethodProxy CGLIBupdate3Proxy;privatestaticfinalMethod CGLIBfinalize4Method;privatestaticfinalMethodProxy CGLIBfinalize4Proxy;privatestaticfinalMethod CGLIBhashCode5Method;privatestaticfinalMethodProxy CGLIBhashCode5Proxy;privatestaticfinalMethod CGLIBclone6Method;privatestaticfinalMethodProxy CGLIBclone6Proxy;privatestaticfinalMethod CGLIBequals7Method;privatestaticfinalMethodProxy CGLIBequals7Proxy;privatestaticfinalMethod CGLIBtoString8Method;privatestaticfinalMethodProxy CGLIBtoString8

CGLIB$STATICHOOK1();

}public()

{

CGLIB$BIND_CALLBACKS(this);

}

}

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/144737.html原文链接:https://javaforall.cn

0 人点赞