Java 有没有办法确定返回的对象是代理对象还是真实对象?

Java 有没有办法确定返回的对象是代理对象还是真实对象?,java,Java,我正在spring@configuration annotation上做一些实验,发现它需要CGLIB,因为它是依赖库。正如我们所知,CGLIB用于在运行时生成代码(在运行时生成代理对象),我需要了解以下代码块返回的bean是代理对象还是真实对象 AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); Person person=(Person)co

我正在spring@configuration annotation上做一些实验,发现它需要CGLIB,因为它是依赖库。正如我们所知,CGLIB用于在运行时生成代码(在运行时生成代理对象),我需要了解以下代码块返回的bean是代理对象还是真实对象

AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
Person person=(Person)context.getBean("person");

AppConfig是我的基于java的配置类。

您应该对您的答案进行一些解释。感谢Don的帮助。
java.​lang.​reflect.Proxy.isProxyClass( person.getClass() ) || org.​springframework.​util.ClassUtils.isCglibProxyClass( person.getClass() )