|
From: Michael S. <mi...@sc...> - 2005-01-11 19:15:56
|
On Tuesday 11 January 2005 18:17, tho...@ac...=20 wrote: > Maybe it's too soon to ask but is there any documention (besides > JavaDoc) available for Spring's JMX module? If all you want to do is expose Spring beans through JMX, you can do it=20 like this. Create an MBeanServer registered as a bean =A0 <bean id=3D"mbeanserver" =A0 =A0class=3D"org.springframework.jmx.factory.MBeanServerFactoryBean"> =A0 =A0 <property name=3D"defaultDomain"><value>MyDomain</value></propert= y> =A0 </bean> Wrap an MBean adapter around my repositorymanager bean (not shown),=20 which is a completely ordinary java object. In this case, public=20 methods are exposed as attributes/operations. Alternatively, metadata =A0 can be used. =A0 <bean id=3D"mbeanadapter" =A0 =A0class=3D"org.springframework.jmx.JmxMBeanAdapter"> =A0 =A0 <property name=3D"server"><ref bean=3D"mbeanserver"/></property> =A0 =A0 <property name=3D"beans"> =A0 =A0 =A0 <map> =A0 =A0 =A0 =A0 <entry key=3D"MyDomain:id=3DRepository"> =A0 =A0 =A0 =A0 =A0 <ref bean=3D"repositorymanager"/> =A0 =A0 =A0 =A0 </entry> =A0 =A0 =A0 </map> =A0 =A0 </property> =A0 </bean> Create a connector listening, by default, on=20 service:jmx:jmxmp://localhost:9876 (this requires=20 jmxremote_optional.jar) =A0 <bean id=3D"jmxconnector" =A0 =A0class=3D"org.springframework.jmx.remote.ConnectorServiceBean"> =A0 =A0 <property name=3D"server"><ref bean=3D"mbeanserver"/></property> =A0 </bean> HTH, Michael --=20 Michael Schuerig Life is just as deadly mailto:mi...@sc... As it looks http://www.schuerig.de/michael/ --Richard Thompson, Sibella |