dubbo Wrapper

 1 public com.alibaba.dubbo.common.bytecode.Wrapper0 exteneds Wrapper{
 2     
 3 
 4     public static String[] pns;
 5     public static java.util.Map pts;
 6     public static String[] mns; // all method name array.
 7     public static String[] dmns;
 8      
 9     public static Class[] mts0;
10     public static Class[] mts1;
11     public static Class[] mts2;
12     public static Class[] mts3;
13     public static Class[] mts4;
14 
15     public String[] getPropertyNames(){ return pns; }
16     public boolean hasProperty(String n){ return pts.containsKey($1); }
17     public Class getPropertyType(String n){ return (Class)pts.get($1); }
18     public String[] getMethodNames(){ return mns; }
19     public String[] getDeclaredMethodNames(){ return dmns; }
20 
21     public void setPropertyValue(Object o, String n, Object v){
22         com.alibaba.dubbo.config.api.DemoService w; 
23         try{
24             w = ((com.alibaba.dubbo.config.api.DemoService)$1); 
25         }catch(Throwable e){ 
26            throw new IllegalArgumentException(e); 
27         } 
28         throw new com.alibaba.dubbo.common.bytecode.NoSuchPropertyException("Not found property \""+$2+"\" filed or setter method in class com.alibaba.dubbo.config.api.DemoService."); 
29     }
30 
31 
32 
33     public Object getPropertyValue(Object o, String n){
34         com.alibaba.dubbo.config.api.DemoService w; 
35         try{
36             w = ((com.alibaba.dubbo.config.api.DemoService)$1); 
37         }catch(Throwable e){
38             throw new IllegalArgumentException(e); 
39         }
40         if( $2.equals("box") ){ return ($w)w.getBox(); }
41         throw new com.alibaba.dubbo.common.bytecode.NoSuchPropertyException("Not found property \""+$2+"\" filed or setter method in class com.alibaba.dubbo.config.api.DemoService."); 
42     }
43 
44 
45     public Object invokeMethod(Object o, String n, Class[] p, Object[] v) throws java.lang.reflect.InvocationTargetException{
46         com.alibaba.dubbo.config.api.DemoService w; 
47         try{ 
48             w = ((com.alibaba.dubbo.config.api.DemoService)$1); 
49         }catch(Throwable e){
50             throw new IllegalArgumentException(e); 
51         } 
52         try{ 
53             if( "sayName".equals( $2 )  &&  $3.length == 1 ) {
54                 return ($w)w.sayName((java.lang.String)$4[0]); 
55             } 
56             if( "getBox".equals( $2 )  &&  $3.length == 0 ) {
57                 return ($w)w.getBox(); 
58             } 
59             if( "getUsers".equals( $2 )  &&  $3.length == 1 ) {
60                 return ($w)w.getUsers((java.util.List)$4[0]); 
61             } 
62             if( "echo".equals( $2 )  &&  $3.length == 1 ) {
63                 return ($w)w.echo(((Number)$4[0]).intValue()); 
64             } 
65             if( "throwDemoException".equals( $2 )  &&  $3.length == 0 ) {
66                 w.throwDemoException(); return null; 
67             } 
68         } catch(Throwable e) {
69             throw new java.lang.reflect.InvocationTargetException(e);  
70         } 
71         throw new com.alibaba.dubbo.common.bytecode.NoSuchMethodException("Not found method \""+$2+"\" in class com.alibaba.dubbo.config.api.DemoService."); 
72     }
73 }

 

转载于:https://www.cnblogs.com/toUpdating/p/9142614.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值