Sorry for jumping in on this so late. The purpose behind this is so that if someone were to set a component directly in the configuration it can be retrieved. E.g., setting a TransactionManager using cfg.setTransactionManager() rather than setting a transaction manager lookup.
But this is legacy since these setters and getters don't exist anymore. I think it is safe to remove the check in the abstract component registry and subsequently the BeanUtils method. I'll issue a pull req in a bit. Cheers Manik On 3 Aug 2011, at 19:39, Sanne Grinovero wrote: > Hello all, > could anybody explain why the ComponentRegistry is performing the > following operation ? > > The method > AbstractComponentRegistry#getFromConfiguration(Class<T>) > > which invokes: > org.infinispan.util.BeanUtils.getterMethod(Class, Class) > > and this one throws thousands of NoSuchMethodException if you have a > rather large number of caches to see if it can find a matching > element, and seems to slow down startup significantly in some cases. > > Throwing such an exception seems to be expected since it's inspecting > Configuration.class (statically!) - it always returns null. > I've tried to remove all those methods and short-circuit a nicely > performing "return null": not a single test failed. > > (No test failed -> useless code, or missing tests) > > Shall I remove the code? > > Cheers, > Sanne > _______________________________________________ > infinispan-dev mailing list > infinispan-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/infinispan-dev -- Manik Surtani ma...@jboss.org twitter.com/maniksurtani Lead, Infinispan http://www.infinispan.org _______________________________________________ infinispan-dev mailing list infinispan-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/infinispan-dev