forked from wang-weidong/css-DesignPattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestDynamicUser.java
More file actions
38 lines (31 loc) · 1.08 KB
/
TestDynamicUser.java
File metadata and controls
38 lines (31 loc) · 1.08 KB
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
package com.css.proxy.rpcdynamic;
import com.css.proxy.rpc.org.HessionOrgService;
import com.css.proxy.rpc.org.OrgService;
import com.css.proxy.rpc.org.WebServiceOrgService;
import com.css.proxy.rpc.user.HessionUserService;
import com.css.proxy.rpc.user.UserService;
import com.css.proxy.rpc.user.WebServiceUserService;
/**
* 测试
*
* 中国软件与技术服务股份有限公司-设计模式培训(Java版)
*
* @author CSS. WangWeidong
*/
public class TestDynamicUser {
public static void main(String[] args) {
// 动态代理
UserService proxy = (UserService) new ServicesProxy().bind(new HessionUserService());
proxy.getUserBaseInfo();
proxy.getUserInfo();
proxy = (UserService) new ServicesProxy().bind(new WebServiceUserService());
proxy.getUserBaseInfo();
proxy.getUserInfo();
OrgService orgProxy = (OrgService) new ServicesProxy().bind(new HessionOrgService());
orgProxy.getOrgBaseInfo();
orgProxy.getOrgInfo();
orgProxy = (OrgService) new ServicesProxy().bind(new WebServiceOrgService());
orgProxy.getOrgBaseInfo();
orgProxy.getOrgInfo();
}
}