mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix code
This commit is contained in:
parent
213a65aa0f
commit
4b646f745f
@ -53,13 +53,12 @@ public final class ProxyUtil {
|
||||
/**
|
||||
* 创建动态代理对象<br>
|
||||
* 动态代理对象的创建原理是:<br>
|
||||
* 假设创建的代理对象名为 $Proxy0<br>
|
||||
* 假设创建的代理对象名为 $Proxy0
|
||||
* 1、根据传入的interfaces动态生成一个类,实现interfaces中的接口<br>
|
||||
* 2、通过传入的classloder将刚生成的类加载到jvm中。即将$Proxy0类load<br>
|
||||
* 3、调用$Proxy0的$Proxy0(InvocationHandler)构造函数 创建$Proxy0的对象,并且用interfaces参数遍历其所有接口的方法,这些实现方法的实现本质上是通过反射调用被代理对象的方法<br>
|
||||
* 4、将$Proxy0的实例返回给客户端。 <br>
|
||||
* 5、当调用代理类的相应方法时,相当于调用 {@link InvocationHandler#invoke(Object, java.lang.reflect.Method, Object[])} 方法
|
||||
* <p> <p>
|
||||
*
|
||||
* @param <T> 被代理对象类型
|
||||
* @param classloader 被代理类对应的ClassLoader
|
||||
|
@ -2,14 +2,14 @@ package cn.hutool.extra.spring;
|
||||
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
|
||||
/**
|
||||
* @author sidian
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@SpringBootTest(classes = EnableSpringUtilTest.class)
|
||||
@EnableSpringUtil
|
||||
public class EnableSpringUtilTest {
|
||||
|
Loading…
x
Reference in New Issue
Block a user