|
From: <jue...@we...> - 2004-12-30 10:14:26
|
Good points! ConnectionServiceBean should indeed stop its =
JMXConnectorServer on context shutdown; I've just added a corresponding =
"destroy" implementation.
=20
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...
=20
I haven't played much with the code yet, so I can't really tell what =
works and what doesn't. Rob, any insights?
=20
Juergen
=20
________________________________
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=3D"mbeanserver"
class=3D"org.springframework.jmx.factory.MBeanServerFactoryBean">
<property name=3D"defaultDomain"><value>MyDomain</value></property>
</bean>
<bean id=3D"mbeanadapter"
class=3D"org.springframework.jmx.JmxMBeanAdapter">
<property name=3D"server"><ref bean=3D"mbeanserver"/></property>
<property name=3D"beans">
<map>
<entry key=3D"MyDomain:id=3DMyBean">
<ref bean=3D"mybean"/>
</entry>
</map>
</property>
</bean>
<bean id=3D"jmxconnector"
class=3D"org.springframework.jmx.remote.ConnectorServiceBean">
<property name=3D"server"><ref bean=3D"mbeanserver"/></property>
<property name=3D"serviceUrl">
<value>service:jmx:jmxmp://localhost:9876</value>
</property>
<property name=3D"threaded"><value>true</value></property>
<property name=3D"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
|