blob: 6a9bcc327dd0a5d21fd91def925b903dbfb90420 [file] [log] [blame]
Guillaume Nodet05fac962009-04-27 10:01:58 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!--
3
4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19-->
20<beans xmlns="http://www.springframework.org/schema/beans"
21 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22 xmlns:ctx="http://www.springframework.org/schema/context"
23 xmlns:osgi="http://www.springframework.org/schema/osgi"
24 xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"
25 xmlns:util="http://www.springframework.org/schema/util"
26 xsi:schemaLocation="
27 http://www.springframework.org/schema/beans
28 http://www.springframework.org/schema/beans/spring-beans.xsd
29 http://www.springframework.org/schema/context
30 http://www.springframework.org/schema/context/spring-context.xsd
31 http://www.springframework.org/schema/util
32 http://www.springframework.org/schema/util/spring-util.xsd
33 http://www.springframework.org/schema/osgi
34 http://www.springframework.org/schema/osgi/spring-osgi.xsd
35 http://www.springframework.org/schema/osgi-compendium
36 http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd">
37
38 <!-- MBeanServer bean -->
39 <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
40 <property name="locateExistingServerIfPossible" value="true"/>
41 </bean>
42
43 <!-- Export the MBeanServer as an OSGi service -->
44 <osgi:service ref="mbeanServer">
45 <osgi:interfaces>
46 <value>javax.management.MBeanServer</value>
47 </osgi:interfaces>
48 </osgi:service>
49
50 <!-- Create a RMI registry -->
51 <bean id="rmiRegistry" class="org.apache.servicemix.management.RmiRegistryFactoryBean">
52 <property name="create" value="true" />
53 <property name="locate" value="true" />
54 <property name="port" value="${rmiRegistryPort}" />
55 </bean>
56
57 <!-- Create a JMX connector ServiceFactory -->
58 <bean id="jmxConnectorService" class="org.springframework.jmx.support.ConnectorServerFactoryBean">
59 <property name="server" ref="mbeanServer" />
60 <property name="serviceUrl" value="${serviceUrl}" />
61 <property name="daemon" value="${daemon}" />
62 <property name="threaded" value="${threaded}" />
63 <property name="objectName" value="${objectName}" />
64 <property name="environment" ref="jmxConnectorEnvironment" />
65 </bean>
66
67 <!-- Environment map for connectors -->
68 <util:map id="jmxConnectorEnvironment">
69 <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator" />
70 </util:map>
71
72 <!-- JAAS authenticator -->
73 <bean id="jaasAuthenticator" class="org.apache.servicemix.management.JaasAuthenticator">
74 <property name="realm" value="${jmxRealm}" />
75 </bean>
76
77 <!-- Property place holder -->
78 <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.management">
79 <prop key="rmiRegistryPort">1099</prop>
80 <prop key="jmxRealm">servicemix</prop>
81 <prop key="serviceUrl">service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi</prop>
82 <prop key="daemon">true</prop>
83 <prop key="threaded">true</prop>
84 <prop key="objectName">connector:name=rmi</prop>
85 </osgix:cm-properties>
86
87 <ctx:property-placeholder properties-ref="cmProps" />
88
89</beans>
90