blob: 5ccd0021aa7ec544b05815bffa0776af4fa83a7e [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 -->
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000039 <bean id="mbeanServerFactory" class="org.apache.felix.karaf.management.MBeanServerFactory" init-method="init" destroy-method="destroy">
Guillaume Nodet05fac962009-04-27 10:01:58 +000040 <property name="locateExistingServerIfPossible" value="true"/>
41 </bean>
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000042 <bean id="mbeanServer" factory-bean="mbeanServerFactory" factory-method="getServer">
43 </bean>
Guillaume Nodet05fac962009-04-27 10:01:58 +000044
45 <!-- Export the MBeanServer as an OSGi service -->
46 <osgi:service ref="mbeanServer">
47 <osgi:interfaces>
48 <value>javax.management.MBeanServer</value>
49 </osgi:interfaces>
50 </osgi:service>
51
52 <!-- Create a RMI registry -->
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000053 <bean id="rmiRegistryFactory" class="org.apache.felix.karaf.management.RmiRegistryFactory" init-method="init" destroy-method="destroy">
Guillaume Nodet05fac962009-04-27 10:01:58 +000054 <property name="create" value="true" />
55 <property name="locate" value="true" />
56 <property name="port" value="${rmiRegistryPort}" />
57 </bean>
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000058 <bean id="rmiRegistry" factory-bean="rmiRegistryFactory" factory-method="getObject"/>
Guillaume Nodet05fac962009-04-27 10:01:58 +000059
60 <!-- Create a JMX connector ServiceFactory -->
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000061 <bean id="jmxConnectorServiceFactory" class="org.apache.felix.karaf.management.ConnectorServerFactory" init-method="init" destroy-method="destroy">
Guillaume Nodet05fac962009-04-27 10:01:58 +000062 <property name="server" ref="mbeanServer" />
63 <property name="serviceUrl" value="${serviceUrl}" />
64 <property name="daemon" value="${daemon}" />
65 <property name="threaded" value="${threaded}" />
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000066 <property name="objectName">
67 <bean class="javax.management.ObjectName" factory-method="getInstance">
68 <constructor-arg value="${objectName}"/>
69 </bean>
70 </property>
71 <property name="environment">
72 <map>
73 <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator" />
74 </map>
75 </property>
Guillaume Nodet05fac962009-04-27 10:01:58 +000076 </bean>
77
Guillaume Nodet05fac962009-04-27 10:01:58 +000078 <!-- JAAS authenticator -->
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000079 <bean id="jaasAuthenticator" class="org.apache.felix.karaf.management.JaasAuthenticator">
Guillaume Nodet05fac962009-04-27 10:01:58 +000080 <property name="realm" value="${jmxRealm}" />
81 </bean>
82
83 <!-- Property place holder -->
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000084 <osgix:cm-properties id="cmProps" persistent-id="org.apache.felix.karaf.management">
Guillaume Nodet05fac962009-04-27 10:01:58 +000085 <prop key="rmiRegistryPort">1099</prop>
Guillaume Nodet25ec8f12009-05-04 06:59:07 +000086 <prop key="jmxRealm">karaf</prop>
Guillaume Nodet05fac962009-04-27 10:01:58 +000087 <prop key="serviceUrl">service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi</prop>
88 <prop key="daemon">true</prop>
89 <prop key="threaded">true</prop>
90 <prop key="objectName">connector:name=rmi</prop>
91 </osgix:cm-properties>
92
93 <ctx:property-placeholder properties-ref="cmProps" />
94
95</beans>
96