One of the few updates in spring 1.2 is JMX support.
Through a simple xml configuration file, the pojo pheasant becomes a phoenix export as a mbean, so that the customer can call the pojo method through the JMX client to view the attributes and status of pojo.
This integration method is the same as spring's integration of quartz, which is transparent and simple and worthy of promotion in the framework field.
The example is in samples/petlinc of spring, which is very simple. For more information, see Chapter 18th of spring refrence.
For example, there is a pojo named myjob. I want to output the excute () and getcallcount () functions for JMX management:
1. Definition of applicationcontext. xml file
<bean id="myJob" class="com.itorgan.myappfuse.job.MyJob"/>
<bean id="jmxExporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<entry key="myappfuse:service=myJob" value-ref="myJob"/>
</map>
</property>
<property name="assembler">
<bean class="org.springframework.jmx.export.assembler.MethodNameBasedMBeanInfoAssembler">
<property name="managedMethods">
<value>execute,getCallCount</value>
</property>
</bean>
</property>
</bean>
2. myjob, the most common pojo, is not described.
3. With JMX client, you can execute myjob. excute () and view the getcallcount () result.
PS. My JMX Environment
1. tomcat5.5 alpha-10
Tomcat5.5 A10 uses the jdt of eclipse 3.1, and finally supports JSP using the jdk1.5 syntax
Modify $ tomcat_home/bin/Catalina. bat
Set catalina_opts =-DCOM. sun. management. jmxremote-DCOM. sun. management. jmxremote. port = 8899-DCOM. sun. management. jmxremote. SSL = false-DCOM. sun. management. jmxremote. authenticate = false
2. mc4j
My favorite JMX client can be downloaded from mc4j.sf.net or the built-in JDK.