1 17 package org.apache.geronimo.axis.client; 18 19 import java.lang.reflect.Method ; 20 import java.lang.reflect.Modifier ; 21 22 import net.sf.cglib.proxy.CallbackFilter; 23 24 27 public class NoOverrideCallbackFilter implements CallbackFilter { 28 private Class superClass; 29 30 public NoOverrideCallbackFilter(Class superClass) { 31 this.superClass = superClass; 32 } 33 34 public int accept(Method method) { 35 if (!Modifier.isPublic(method.getModifiers())) { 37 return 0; 38 } 39 40 if (method.getName().equals("remove") && Modifier.isAbstract(method.getModifiers())) { 41 return 1; 42 } 43 44 try { 45 superClass.getMethod(method.getName(), method.getParameterTypes()); 47 return 0; 48 } catch (Throwable e) { 49 return 1; 50 } 51 } 52 53 public boolean equals(Object other) { 54 if (other == null) { 55 return false; 56 } 57 if (other == this) { 58 return true; 59 } 60 61 NoOverrideCallbackFilter otherFilter = null; 62 if (other instanceof NoOverrideCallbackFilter) { 63 otherFilter = (NoOverrideCallbackFilter) other; 64 } 65 else { 66 return false; 67 } 68 69 return superClass.equals(otherFilter.superClass); 70 } 71 72 public int hashCode() 73 { 74 return superClass.hashCode(); 75 } 76 77 } 78 | Popular Tags |