// properties. The getters will
// in fact never get called as the intercepter will return the cached
// result of the previous setter.
final Method[] methods = clazz.getMethods();
final BeanGenerator beanGenerator = new BeanGenerator();
beanGenerator.setSuperclass(clazz);
for (int i = 0; i < methods.length; i++) {
final Method m = methods[i];
if (ReflectUtils.isSetter(m)) {
beanGenerator.addProperty(ReflectUtils.getPropertyName(m), ReflectUtils.getPropertyType(m));
}
}
//
// Enhance the class by placing a GetCachingMethodInterceptor
// intercepter on all the getter and setter methods.
final Class newClazz = (Class) beanGenerator.createClass();
final Callback[] callbacks = new Callback[] { new GetCachingMethodInterceptor(clazz.newInstance()), NoOp.INSTANCE };
return (ConnectionFactory) Enhancer.create(newClazz, new Class[] { ConnectionFactory.class, QueueConnectionFactory.class, TopicConnectionFactory.class }, new CallbackFilter() {
public int accept(Method m) {