Пример #1
0
 @Test
 public void testCglibProxy() {
   CglibProxyFactory cglibProxyFactory = new CglibProxyFactory();
   UserService service = (UserService) cglibProxyFactory.getInstance(new UserServiceImpl());
   service.saveUser();
 }
Пример #2
0
 @Test
 public void testJDKProxy() {
   JDKProxyFactory jdkProxyFactory = JDKProxyFactory.JDKProxy.getInstance();
   UserService service = (UserService) jdkProxyFactory.bind(new UserServiceImpl());
   service.saveUser();
 }