我是靠谱客的博主 无聊皮卡丘,最近开发中收集的这篇文章主要介绍dubbo生成实现类的Wrapper类,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

ClassLoader:
+-sun.misc.Launcher$AppClassLoader@18b4aac2
+-sun.misc.Launcher$ExtClassLoader@3c09711b
Location:
/D:/github/dubbo/dubbo/dubbo-common/target/classes/
/*
* Decompiled with CFR.
*
* Could not load the following classes:
*
org.apache.dubbo.common.bytecode.ClassGenerator
*
org.apache.dubbo.common.bytecode.ClassGenerator$DC
*
org.apache.dubbo.common.bytecode.NoSuchMethodException
*
org.apache.dubbo.common.bytecode.NoSuchPropertyException
*
org.apache.dubbo.common.bytecode.Wrapper
*
org.apache.dubbo.demo.provider.DemoServiceImpl
*/
package org.apache.dubbo.common.bytecode;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.dubbo.common.bytecode.ClassGenerator;
import org.apache.dubbo.common.bytecode.NoSuchMethodException;
import org.apache.dubbo.common.bytecode.NoSuchPropertyException;
import org.apache.dubbo.common.bytecode.Wrapper;
import org.apache.dubbo.demo.provider.DemoServiceImpl;
public class Wrapper1
extends Wrapper
implements ClassGenerator.DC {
public static String[] pns;
public static Map pts;
public static String[] mns;
public static String[] dmns;
public static Class[] mts0;
public static Class[] mts1;
public String[] getPropertyNames() {
return pns;
}
public boolean hasProperty(String string) {
return pts.containsKey(string);
}
public Class getPropertyType(String string) {
return (Class)pts.get(string);
}
public String[] getMethodNames() {
return mns;
}
public String[] getDeclaredMethodNames() {
return dmns;
}
public void setPropertyValue(Object object, String string, Object object2) {
try {
DemoServiceImpl demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
throw new NoSuchPropertyException(new StringBuffer().append("Not found p
roperty "").append(string).append("" field or setter method in class org.apach
e.dubbo.demo.provider.DemoServiceImpl.").toString());
}
public Object getPropertyValue(Object object, String string) {
try {
DemoServiceImpl demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
throw new NoSuchPropertyException(new StringBuffer().append("Not found p
roperty "").append(string).append("" field or setter method in class org.apach
e.dubbo.demo.provider.DemoServiceImpl.").toString());
}
public Object invokeMethod(Object object, String string, Class[] arrclass, O
bject[] arrobject) throws InvocationTargetException {
DemoServiceImpl demoServiceImpl;
try {
demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
try {
if ("testException".equals(string) && arrclass.length == 0) {
return new Integer(demoServiceImpl.testException());
}
if ("sayHello".equals(string) && arrclass.length == 1) {
return demoServiceImpl.sayHello((String)arrobject[0]);
}
}
catch (Throwable throwable) {
throw new InvocationTargetException(throwable);
}
throw new NoSuchMethodException(new StringBuffer().append("Not found met
hod "").append(string).append("" in class org.apache.dubbo.demo.provider.DemoS
erviceImpl.").toString());
}
}
Affect(row-cnt:1) cost in 843 ms.
[arthas@29244]$ jad org.apache.dubbo.common.bytecode.Wrapper1
jad org.apache.dubbo.common.bytecode.Wrapper1
ClassLoader:
+-sun.misc.Launcher$AppClassLoader@18b4aac2
+-sun.misc.Launcher$ExtClassLoader@3c09711b
Location:
/D:/github/dubbo/dubbo/dubbo-common/target/classes/
/*
* Decompiled with CFR.
*
* Could not load the following classes:
*
org.apache.dubbo.common.bytecode.ClassGenerator
*
org.apache.dubbo.common.bytecode.ClassGenerator$DC
*
org.apache.dubbo.common.bytecode.NoSuchMethodException
*
org.apache.dubbo.common.bytecode.NoSuchPropertyException
*
org.apache.dubbo.common.bytecode.Wrapper
*
org.apache.dubbo.demo.provider.DemoServiceImpl
*/
package org.apache.dubbo.common.bytecode;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.apache.dubbo.common.bytecode.ClassGenerator;
import org.apache.dubbo.common.bytecode.NoSuchMethodException;
import org.apache.dubbo.common.bytecode.NoSuchPropertyException;
import org.apache.dubbo.common.bytecode.Wrapper;
import org.apache.dubbo.demo.provider.DemoServiceImpl;
public class Wrapper1
extends Wrapper
implements ClassGenerator.DC {
public static String[] pns;
public static Map pts;
public static String[] mns;
public static String[] dmns;
public static Class[] mts0;
public static Class[] mts1;
public String[] getPropertyNames() {
return pns;
}
public boolean hasProperty(String string) {
return pts.containsKey(string);
}
public Class getPropertyType(String string) {
return (Class)pts.get(string);
}
public String[] getMethodNames() {
return mns;
}
public String[] getDeclaredMethodNames() {
return dmns;
}
public void setPropertyValue(Object object, String string, Object object2) {
try {
DemoServiceImpl demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
throw new NoSuchPropertyException(new StringBuffer().append("Not found property "").append(string).append("" field or setter method in class org.apache.dubbo.demo.provider.DemoServiceImpl.").toString());
}
public Object getPropertyValue(Object object, String string) {
try {
DemoServiceImpl demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
throw new NoSuchPropertyException(new StringBuffer().append("Not found property "").append(string).append("" field or setter method in class org.apache.dubbo.demo.provider.DemoServiceImpl.").toString());
}
public Object invokeMethod(Object object, String string, Class[] arrclass, Object[] arrobject) throws InvocationTargetException {
DemoServiceImpl demoServiceImpl;
try {
demoServiceImpl = (DemoServiceImpl)object;
}
catch (Throwable throwable) {
throw new IllegalArgumentException(throwable);
}
try {
if ("testException".equals(string) && arrclass.length == 0) {
return new Integer(demoServiceImpl.testException());
}
if ("sayHello".equals(string) && arrclass.length == 1) {
return demoServiceImpl.sayHello((String)arrobject[0]);
}
}
catch (Throwable throwable) {
throw new InvocationTargetException(throwable);
}
throw new NoSuchMethodException(new StringBuffer().append("Not found method "").append(string).append("" in class org.apache.dubbo.demo.provider.DemoServiceImpl.").toString());
}
}

 

最后

以上就是无聊皮卡丘为你收集整理的dubbo生成实现类的Wrapper类的全部内容,希望文章能够帮你解决dubbo生成实现类的Wrapper类所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部