我是靠谱客的博主 无聊皮卡丘,这篇文章主要介绍dubbo生成实现类的Wrapper类,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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生成实现类内容请搜索靠谱客的其他文章。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部