+ " because it has at least one non-static, final method with public, protected or default visibility");
}
}
try
{
ProxyFactory factory = new ProxyFactory();
factory.setSuperclass(superClass);
factory.setFilter(MethodFilterHolder.METHOD_FILTER);
MethodHandler handler = new MethodHandler()
{
public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable
{
if ((!Modifier.isPublic(m.getModifiers()) || !Modifier.isPublic(m.getDeclaringClass()
.getModifiers())) && !m.isAccessible())
m.setAccessible(true);
return m.invoke(provider.get(), args);
}
};
return superClass.cast(factory.create(new Class<?>[0], new Object[0], handler));
}
catch (Exception e)
{
throw new UnproxyableResolutionException("Cannot create a proxy for the class " + superClass.getName(),
e);