Point checkin.

Inserting a password-protected MBean and associated RMI-based 
 MBeanServer into the Alfresco webapp context.

 Right now, it's just in "hello world" condition,
 but you can say: 

        jconsole service:jmx:rmi:///jndi/rmi://your-alfresco-box:50500/alfresco/jmxrmi

 and browse the MBean  (assuming you know the associated jmxrolename/password).
 Just one property right now ("moo"), but fleshes out all the major issues
 for isolating the JMX for our MBean from the JMX for the JVM as a whole.




git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4441 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jon Cox
2006-11-24 19:08:01 +00:00
parent 65ba5f5024
commit 0eda95cc5f
7 changed files with 246 additions and 3 deletions

View File

@@ -8,6 +8,11 @@
<!-- PERSISTENCE -->
<!-- -->
<!-- Load runtime-dependent properties (e.g.: alfresco.jmx.dir). -->
<!-- Note: This bean relies on PropertyPlaceholderConfigurer -->
<bean id="runtimeProperties" class="org.alfresco.util.RuntimeSystemPropertiesSetter"/>
<!-- load common properties -->
<bean id="repository-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders">
@@ -15,6 +20,7 @@
</property>
<property name="locations">
<list>
<value>classpath:alfresco/alfresco-shared.properties</value>
<value>classpath:alfresco/repository.properties</value>
<value>classpath:alfresco/version.properties</value>
<value>classpath:alfresco/domain/transaction.properties</value>
@@ -22,6 +28,52 @@
</property>
</bean>
<!-- Custom MBeanServer -->
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"/>
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
<property name="port" value="${avm.jmxrmi.port}"/>
</bean>
<!-- MBeanServer Connector (registers itself with custom mbeanServer) -->
<bean id="serverConnector"
class="org.springframework.jmx.support.ConnectorServerFactoryBean"
depends-on="registry">
<property name="objectName" value="connector:name=rmi"/>
<property name="server" ref="mbeanServer"/>
<property name="serviceUrl" value="service:jmx:rmi://localhost/jndi/rmi://localhost:${avm.jmxrmi.port}/alfresco/jmxrmi" />
<property name="environment">
<map>
<!-- The following keys are only valid when sun jmx is used -->
<entry key="jmx.remote.x.password.file" value="${alfresco.jmx.dir}/alfresco-jmxrmi.password"/>
<entry key="jmx.remote.x.access.file" value="${alfresco.jmx.dir}/alfresco-jmxrmi.access"/>
</map>
</property>
</bean>
<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
<property name="beans">
<map>
<!-- MBeans to register with mbeanServer -->
<entry key="Alfresco:Name=VirtServerRegistry" value-ref="VirtServerRegistry"/>
</map>
</property>
<property name="server" ref="mbeanServer"/>
</bean>
<!-- MBeans registered with mbeanServer -->
<bean id="VirtServerRegistry" class="org.alfresco.mbeans.VirtServerRegistry">
<property name="moo" value="1"/>
</bean>
<!-- Datasource bean -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">