Code example for ProxyFactory

Methods: getProxy

0
 
	@Test
	public void testAopJdkProxyWithDetectedInterfaces() throws Exception {
		ModelMap map = new ModelMap();
		Map<?, ?> target = new HashMap<Object, Object>();
		ProxyFactory factory = new ProxyFactory(target);
		Object proxy = factory.getProxy();
		map.addAttribute(proxy);
		assertSame(proxy, map.get("map"));
	} 
 
	@Test
	public void testRawJdkProxy() throws Exception {
		ModelMap map = new ModelMap();
		Object proxy = Proxy.newProxyInstance(
				getClass().getClassLoader(),
				new Class<?>[] {Map.class},
				new InvocationHandler() {
					@Override 
					public Object invoke(Object proxy, Method method, Object[] args) {
Contextual code suggestions in your IDE  Get Codota for Java