blob: afe538be7927ab80883367e0e4d5ac179f1a7f57 [file] [log] [blame]
Guillaume Nodetfcf2d342009-06-18 20:57:23 +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<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
21 xmlns:cm="http://www.osgi.org/xmlns/blueprint-cm/v1.0.0">
22
23 <!-- Property place holder -->
24 <cm:property-placeholder persistent-id="org.apache.felix.karaf.management">
25 <cm:default-properties>
26 <cm:property name="rmiRegistryPort" value="1099"/>
27 <cm:property name="jmxRealm" value="karaf"/>
28 <cm:property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"/>
29 <cm:property name="daemon" value="true"/>
30 <cm:property name="threaded" value="true"/>
31 <cm:property name="objectName" value="connector:name=rmi"/>
32 </cm:default-properties>
33 </cm:property-placeholder>
34
35 <!-- MBeanServer bean -->
36 <bean id="mbeanServerFactory" class="org.apache.felix.karaf.management.MBeanServerFactory" init-method="init" destroy-method="destroy" depends-on="rmiRegistryFactory">
37 <property name="locateExistingServerIfPossible" value="true"/>
38 </bean>
39 <bean id="mbeanServer" factory-ref="mbeanServerFactory" factory-method="getServer"/>
40
41 <!-- Export the MBeanServer as an OSGi service -->
42 <service ref="mbeanServer" interface="javax.management.MBeanServer"/>
43
44 <!-- Create a RMI registry -->
45 <bean id="rmiRegistryFactory" class="org.apache.felix.karaf.management.RmiRegistryFactory" init-method="init" destroy-method="destroy">
46 <property name="create" value="true"/>
47 <property name="locate" value="true"/>
48 <property name="port" value="${rmiRegistryPort}"/>
49 </bean>
50
51 <!-- Create a JMX connector ServiceFactory -->
52 <bean id="connectorFactory" class="org.apache.felix.karaf.management.ConnectorServerFactory" init-method="init" destroy-method="destroy">
53 <property name="server" ref="mbeanServer"/>
54 <property name="serviceUrl" value="${serviceUrl}"/>
55 <property name="daemon" value="${daemon}"/>
56 <property name="threaded" value="${threaded}"/>
57 <property name="objectName" value="${objectName}"/>
58 <property name="environment">
59 <map>
60 <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator"/>
61 </map>
62 </property>
63 </bean>
64
65 <!-- JAAS authenticator -->
66 <bean id="jaasAuthenticator" class="org.apache.felix.karaf.management.JaasAuthenticator">
67 <property name="realm" value="${jmxRealm}"/>
68 </bean>
69
70</blueprint>
71