|
From: Rob H. <ro...@ca...> - 2004-12-07 12:57:01
|
All, I am looking at ways to support lazy-init and prototype beans in Spring JMX. The biggest issue is that in order to register a ModelMBean you need to supply the managed resource instance, in this case the bean up front. An obvious solution to this is to provide an AOP interceptor for lazy-init beans that can be passed to the ModelMBean as the managed resources but which only inits the bean when the first method is invoked. This leads me onto the main point which is: what is the best to go about applying this interceptor. I see three solutions: 1. Have the user create the proxy manually. 2. Modify JmxMBeanAdapter to accept a Map of bean names instead of a Map of beans and use the BeanDefinition to determine if the bean is lazy-init or not, applying the AOP interceptor dynamically as required. 3. Modify JmxMBeanAdapter to accept a Map of beans OR bean names and then decide dynamically how to proceed. What are our thoughts? Rob |