Code:<bean id="connector" class="org.springframework.jmx.support.MBeanServerConnectionFactoryBean" lazy-init="true" scope="prototype"> <property name="serviceUrl" value="service:jmx:rmi://..."/> </bean> <bean id="control" class="org.springframework.jmx.access.MBeanProxyFactoryBean" lazy-init="true" scope="prototype"> <property name="objectName" value="..." /> <property name="proxyInterface" value="a.b.c.Control" /> <property name="server" ref="connector" /> <property name="connectOnStartup" value="false" /> </bean> <!-- use the factory to lookup the control, in case the jmx server restarts --> <bean id="controlFactory" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean"> <property name="targetBeanName"> <idref local="control" /> </property> </bean>


Reply With Quote