Code example for ProxyFactory

Methods: getProxy, addAdvice

0
 
	// Helpers 
	// ========================================================================= 
	 
	LdapOperations ops() { 
	    ProxyFactory factory = new ProxyFactory(new Class[]{LdapOperations.class}); 
	    factory.addAdvice(new MethodInterceptor(){ 
 
            public Object invoke(MethodInvocation arg0) throws Throwable { 
                throw new UnsupportedOperationException(); 
            }}); 
	    return (LdapOperations) factory.getProxy(); 
	} 
	 
} 
Experience pair programming with AI  Get Codota for Java