spring-jmx.xml

<?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd    
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
    default-lazy-init="true">
  
  
 
    <bean name="myobj" class="cn.edu.hbcf.tmp.MyObject">  
        <property name="id">  
            <value>90000000001</value>  
        </property>  
        <property name="name">  
            <value>shirdrn</value>  
        </property>  
    </bean>  
    
    
        
    <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter"  
        depends-on="mbeanServer">  
         <property name="beans">  
            <map>  
                <entry key="mydomain:myjavaobj=MyJavaObject" value-ref="myobj"/>  
            </map>  
        </property>   
        <property name="server" ref="mbeanServer" />  
        <property name="assembler">  
              <ref bean="assembler" />  
        </property>  
    </bean>  
    
    
    <bean id="assembler"  
        class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">  
        <property name="managedInterfaces">  
            <list>  
                <value>cn.edu.hbcf.tmp.SelectedMethodsInterface</value>  
            </list>  
        </property>  
    </bean>  
    
    <bean id="server" class="org.springframework.jmx.support.ConnectorServerFactoryBean" depends-on="registry">  
        <property name="objectName">  
            <value>connector:name=rmi</value>  
        </property>  
        <property name="serviceUrl">  
            <value>service:jmx:rmi://localhost/jndi/rmi://localhost:1099/jmxrmi</value>  
        </property>  
    </bean>  
    <bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">  
        <property name="port">  
            <value>1099</value>  
        </property>  
    </bean>  

    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean" />  
    <bean id="httpAdaptor" class="mx4j.tools.adaptor.http.HttpAdaptor">  
        <property name="processor">  
            <ref bean="xsltProcessor" />  
        </property>   
        <property name="host">  
            <value>127.0.0.1</value>  
        </property>  
        <property name="port" value="9988" />  
    </bean>  
    <bean id="xsltProcessor" class="mx4j.tools.adaptor.http.XSLTProcessor" />  
    <bean id="config" class="cn.edu.hbcf.common.utils.MyConfiguration" />  
      
  
   
  
</beans>   
原文地址:https://www.cnblogs.com/zrui-xyu/p/4942961.html