-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
86 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/com/mxy/design/proxy/dynamic/cglib/proxy/TeacherService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.mxy.design.proxy.dynamic.cglib.proxy; | ||
|
||
public class TeacherService { | ||
|
||
public TeacherService() { | ||
System.out.println("teacherService===>基类类构造方法"); | ||
} | ||
public TeacherService(String str) { | ||
//避免与当通过代理初始化对象空构造时候打印内容混淆 | ||
} | ||
|
||
public void save() { | ||
System.out.println("保存ing"); | ||
} | ||
|
||
public void delete() { | ||
System.out.println("删除ing"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/com/mxy/design/proxy/dynamic/jdk/proxy/SchoolImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.mxy.design.proxy.dynamic.jdk.proxy; | ||
|
||
import com.mxy.design.proxy.ISchool; | ||
|
||
public class SchoolImpl implements ISchool { | ||
|
||
public SchoolImpl(){ | ||
//JDK动态代理通过反射会调用这个方法 | ||
System.out.println(SchoolImpl.class+":JDK 动态代理反射调用。"); | ||
} | ||
|
||
public SchoolImpl(String str) { | ||
//避免与当通过代理初始化对象空构造时候打印内容混淆 | ||
} | ||
|
||
@Override | ||
public void save() { | ||
System.out.println("保存学校信息ing"); | ||
} | ||
|
||
@Override | ||
public void delete() { | ||
System.out.println("删除学校信息ing"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters