|
From: Rob H. <ro...@ca...> - 2004-12-30 16:00:18
|
Juergen/Michael, The JmxMBeanAdapter already has code to unregister all beans from the MBeanServer on shutdown - and provided the JmxMbeanAdapter itself is collectable by the GC then it shouldn't prevent the MBeanServer or any of the beans from being GC'd. If the MBeanServer is provided by the application/servlet container then it wont be GC'd but all beans should be unregistered when the ApplicationContext is destroyed. ConnectorServiceBean should shutdown its connection on destroy - thanks for adding that Juergen. There is an option to start the ConnectorServiceBean in a separate thread and a second option allowing for this thread to be made a daemon. Rob jürgen höller [werk3AT] wrote: >Good points! ConnectionServiceBean should indeed stop its JMXConnectorServer on context shutdown; I've just added a corresponding "destroy" implementation. > >Also, every MBean registered with the MBeanServer by Spring support classes should be unregistered on context shutdown. It looks this already happens, though, in JmxMBeanAdapter... > >I haven't played much with the code yet, so I can't really tell what works and what doesn't. Rob, any insights? > >Juergen > > >________________________________ > >Von: spr...@li... im Auftrag von Michael Schuerig >Gesendet: Mi 29.12.2004 22:43 >An: spr...@li... >Betreff: [Springframework-user] JMX: stopping MBeanServer and Connector > > > > >I've tried to use the JMX support in the sandbox to add manageability to >a web app. In general, I'm impressed how easy this appears to be (after >getting an idea of how the support classes work). I'm not completely >sure I'm using everything in the way it was intended, thus I appreciate >any corrections. The relevant excerpt from the application context is >at below. > >I noticed a couple of things, where I'm not clear, whether I don't >understand them or if there's a real problem lurking: > >- The ConnectorServiceBean needs to be run in a separate daemon thread >or else Tomcat doesn't really quit when told to shut down. > >- On stopping and reloading of a web app, ConnectorServiceBean should >stop its JMXConnectorServer. Otherwise the server port remains in use >and the app can't be started again. > >- What happens to the associated MBeanServer on stopping and reloading >of a web app? It still holds references to MBeans and application >objects/classes. Presumably the MBeanServer needs to shut down in some >way. > >Michael > > > <bean id="mbeanserver" > class="org.springframework.jmx.factory.MBeanServerFactoryBean"> > <property name="defaultDomain"><value>MyDomain</value></property> > </bean> > > <bean id="mbeanadapter" > class="org.springframework.jmx.JmxMBeanAdapter"> > <property name="server"><ref bean="mbeanserver"/></property> > <property name="beans"> > <map> > <entry key="MyDomain:id=MyBean"> > <ref bean="mybean"/> > </entry> > </map> > </property> > </bean> > > <bean id="jmxconnector" > class="org.springframework.jmx.remote.ConnectorServiceBean"> > <property name="server"><ref bean="mbeanserver"/></property> > <property name="serviceUrl"> > <value>service:jmx:jmxmp://localhost:9876</value> > </property> > <property name="threaded"><value>true</value></property> > <property name="daemon"><value>true</value></property> > </bean> > >-- >Michael Schuerig Most people would rather die than think. >mailto:mi...@sc... In fact, they do. >http://www.schuerig.de/michael/ --Bertrand Russell > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://productguide.itmanagersjournal.com/ >_______________________________________________ >Springframework-user mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-user > > > > >------------------------------------------------------- >The SF.Net email is sponsored by: Beat the post-holiday blues >Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. >It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > |