public static byte[] dump() throws Exception {
ClassWriter cw = new ClassWriter(0);
FieldVisitor fv;
MethodVisitor mv;
AnnotationVisitor av0;
cw.visit(
V1_6,
ACC_PUBLIC + ACC_SUPER,
"net/sf/joafip/store/service/proxy/JoafipObject",
null,
"java/lang/Object",
new String[] { "net/sf/joafip/store/service/proxy/IProxyCallBack" });
{
av0 = cw.visitAnnotation("Lnet/sf/joafip/NotStorableClass;", true);
av0.visitEnd();
}
{
fv = cw.visitField(
ACC_PRIVATE + ACC_TRANSIENT,
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;",
null, null);
fv.visitEnd();
}
{
fv = cw.visitField(ACC_PRIVATE + ACC_TRANSIENT,
"setProxyCallBackTrace", "Ljava/lang/Exception;", null,
null);
fv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>",
"()V");
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETSTATIC,
"net/sf/joafip/store/service/proxy/NullProxyCallBack",
"INSTANCE",
"Lnet/sf/joafip/store/service/proxy/NullProxyCallBack;");
mv.visitFieldInsn(PUTFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitInsn(RETURN);
mv.visitMaxs(2, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"getProxyCallBack$JOAFIP$",
"()Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;",
null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitInsn(ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"setProxyCallBack$JOAFIP$",
"(Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;)V",
null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitFieldInsn(GETSTATIC,
"net/sf/joafip/store/service/proxy/NullProxyCallBack",
"INSTANCE",
"Lnet/sf/joafip/store/service/proxy/NullProxyCallBack;");
Label l0 = new Label();
mv.visitJumpInsn(IF_ACMPEQ, l0);
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitJumpInsn(IFNULL, l0);
mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
mv.visitInsn(DUP);
mv.visitTypeInsn(NEW, "java/lang/StringBuilder");
mv.visitInsn(DUP);
mv.visitLdcInsn("for ");
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/StringBuilder",
"<init>", "(Ljava/lang/String;)V");
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/Object", "getClass",
"()Ljava/lang/Class;");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;");
mv.visitLdcInsn("@");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESTATIC, "java/lang/System",
"identityHashCode", "(Ljava/lang/Object;)I");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"append", "(I)Ljava/lang/StringBuilder;");
mv.visitLdcInsn(" proxy call back already set to ");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"append", "(Ljava/lang/Object;)Ljava/lang/StringBuilder;");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder",
"toString", "()Ljava/lang/String;");
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"setProxyCallBackTrace", "Ljava/lang/Exception;");
mv.visitMethodInsn(INVOKESPECIAL,
"java/lang/IllegalStateException", "<init>",
"(Ljava/lang/String;Ljava/lang/Throwable;)V");
mv.visitInsn(ATHROW);
mv.visitLabel(l0);
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitVarInsn(ALOAD, 1);
Label l1 = new Label();
mv.visitJumpInsn(IFNONNULL, l1);
mv.visitTypeInsn(NEW, "java/lang/IllegalArgumentException");
mv.visitInsn(DUP);
mv.visitLdcInsn("argument can not be null");
mv.visitMethodInsn(INVOKESPECIAL,
"java/lang/IllegalArgumentException", "<init>",
"(Ljava/lang/String;)V");
mv.visitInsn(ATHROW);
mv.visitLabel(l1);
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ALOAD, 1);
mv.visitFieldInsn(PUTFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitVarInsn(ALOAD, 0);
mv.visitTypeInsn(NEW, "java/lang/Exception");
mv.visitInsn(DUP);
mv.visitLdcInsn("setted proxy call back trace");
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Exception", "<init>",
"(Ljava/lang/String;)V");
mv.visitFieldInsn(PUTFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"setProxyCallBackTrace", "Ljava/lang/Exception;");
mv.visitInsn(RETURN);
mv.visitMaxs(5, 2);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"setIsLoaded$JOAFIP$",
"()V",
null,
new String[] { "net/sf/joafip/store/service/objectio/ObjectIOException" });
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"setIsLoaded$JOAFIP$", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "setLoading$JOAFIP$", "(Z)V", null,
null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitVarInsn(ILOAD, 1);
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"setLoading$JOAFIP$", "(Z)V");
mv.visitInsn(RETURN);
mv.visitMaxs(2, 2);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "intercept$JOAFIP$", "()V", null,
null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"intercept$JOAFIP$", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "methodEnd$JOAFIP$", "()V", null,
null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"methodEnd$JOAFIP$", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PROTECTED, "forceLoad$JOAFIP$",
"(Ljava/lang/Object;)V", null, null);
mv.visitCode();
Label l0 = new Label();
Label l1 = new Label();
Label l2 = new Label();
mv.visitTryCatchBlock(l0, l1, l2, "java/lang/Exception");
mv.visitVarInsn(ALOAD, 1);
mv.visitVarInsn(ALOAD, 0);
Label l3 = new Label();
mv.visitJumpInsn(IF_ACMPEQ, l3);
mv.visitLabel(l0);
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKESTATIC,
"net/sf/joafip/store/service/proxy/ProxyManager2",
"forceLoad", "(Ljava/lang/Object;)V");
mv.visitLabel(l1);
mv.visitJumpInsn(GOTO, l3);
mv.visitLabel(l2);
mv.visitFrame(Opcodes.F_SAME1, 0, null, 1,
new Object[] { "java/lang/Exception" });
mv.visitVarInsn(ASTORE, 2);
mv.visitTypeInsn(NEW,
"net/sf/joafip/store/service/proxy/JoafipObjectException");
mv.visitInsn(DUP);
mv.visitVarInsn(ALOAD, 2);
mv.visitMethodInsn(INVOKESPECIAL,
"net/sf/joafip/store/service/proxy/JoafipObjectException",
"<init>", "(Ljava/lang/Throwable;)V");
mv.visitInsn(ATHROW);
mv.visitLabel(l3);
mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mv.visitInsn(RETURN);
mv.visitMaxs(3, 3);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"forceLoad$JOAFIP$",
"()V",
null,
new String[] {
"net/sf/joafip/store/service/objectio/ObjectIOException",
"net/sf/joafip/store/service/objectio/ObjectIODataRecordNotFoundException",
"net/sf/joafip/store/service/objectio/ObjectIOInvalidClassException",
"net/sf/joafip/store/service/objectio/ObjectIOClassNotFoundException",
"net/sf/joafip/store/service/objectio/ObjectIODataCorruptedException",
"net/sf/joafip/store/service/objectio/ObjectIONotSerializableException" });
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"forceLoad$JOAFIP$", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC,
"getMyFileAccessSessionIdentifier$JOAFIP$", "()J", null,
null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"getMyFileAccessSessionIdentifier$JOAFIP$", "()J");
mv.visitInsn(LRETURN);
mv.visitMaxs(2, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(ACC_PUBLIC, "getProxiedClass$JOAFIP$",
"()Lnet/sf/joafip/store/entity/classinfo/ClassInfo;", null,
null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"getProxiedClass$JOAFIP$",
"()Lnet/sf/joafip/store/entity/classinfo/ClassInfo;");
mv.visitInsn(ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"isLoaded$JOAFIP$",
"()Z",
null,
new String[] { "net/sf/joafip/store/service/objectio/ObjectIOException" });
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"isLoaded$JOAFIP$", "()Z");
mv.visitInsn(IRETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"unload$JOAFIP$",
"()V",
null,
new String[] {
"net/sf/joafip/store/service/objectio/ObjectIOException",
"net/sf/joafip/store/service/objectio/ObjectIOInvalidClassException" });
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"unload$JOAFIP$", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
{
mv = cw.visitMethod(
ACC_PUBLIC,
"getObjectIOManager$JOAFIP$",
"()Lnet/sf/joafip/store/service/objectio/manager/IObjectIOManagerForProxyObjectIO;",
null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD,
"net/sf/joafip/store/service/proxy/JoafipObject",
"proxyCallBack",
"Lnet/sf/joafip/store/service/proxy/IProxyCallBackToImplement;");
mv.visitMethodInsn(
INVOKEINTERFACE,
"net/sf/joafip/store/service/proxy/IProxyCallBackToImplement",
"getObjectIOManager$JOAFIP$",
"()Lnet/sf/joafip/store/service/objectio/manager/IObjectIOManagerForProxyObjectIO;");
mv.visitInsn(ARETURN);
mv.visitMaxs(1, 1);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}