Java??????????????????????????
???????????? ???????[ 2012/8/13 10:37:46 ] ????????
????SetProxyFactory ??????????????????? getSetProxy()???????????????? Set ?????????????????????? Set —— ??????????????????????????????????????????SetProxyFactory ???????????????£?????????????????????????? Set ??????????????????????????????????????????????????????????? —— ??????????? Set ????????????????????????t???????t?????????????????????????????????????????????????????е????????????
????????????????????
?????????? SetProxyFactory ???????????????????????????и???????? —— ???????????????????????Χ??С???????????????????????????????????????????????????????????????????????????????ε???????????????????嵥 3 ??????????壬????????????????????л???????????????????????????????????? IDE ??????????????????? Adapter ????
?????嵥 3. ???????????
1.public interface ServiceCallback {
2. public void doCallback();
3. }
4.public interface Service {
5. public void serviceMethod(ServiceCallback callback);
6. }
7.public class ServiceConsumer implements ServiceCallback {
8. private Service service;
9....
10. public void someMethod() {
11. ...
12. service.serviceMethod(this);
13. }
14. }
????ServiceConsumer ??????? ServiceCallback???????????????????????????????? this ???????? serviceMethod() ?????????á??????????????????л????????? Service ???? ServiceCallback ????? ServiceConsumer???????? ServiceConsumer ????? Service ????????????????????????????? —— ??????????????????????????????????????????????д???????????????????????????嵥 4 ?е? ServiceCallbackAdapter?????? ServiceCallbackAdapter ??? ServiceConsumer??ServiceCallbackAdapter ??? Service ?? ServiceCallback ????? ServiceConsumer??
?????嵥 4. ?????????????????????????????????????????????????
1.public class ServiceCallbackAdapter implements ServiceCallback {
2. private final ServiceCallback cb;
3.public ServiceCallbackAdapter(ServiceCallback cb) {
4. this.cb = cb;
5. }
6.public void doCallback() {
7. cb.doCallback();
8. }
9. }
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11