1 package dynaop.remote; 2 3 import java.net.URL ; 4 5 import dynaop.Aspects; 6 import dynaop.Pointcuts; 7 import dynaop.ProxyFactory; 8 9 15 public class Home { 16 17 21 public Object create(URL url, Class intf) { 22 if (url == null) 23 throw new NullPointerException ("URL is null"); 24 25 Aspects aspects = new Aspects(); 26 aspects.interfaces(Pointcuts.ALL_CLASSES, new Class [] { intf }); 27 aspects.interceptor( 28 Pointcuts.ALL_CLASSES, 29 Pointcuts.not(Pointcuts.OBJECT_METHODS), 30 new StubInterceptor() 31 ); 32 33 Object stub = ProxyFactory.getInstance(aspects).wrap(url); 35 36 return stub; 37 } 38 } 39 | Popular Tags |