blob: a8dcfd9d1f262a5f12aae2cb4d3ffad3912ac9f1 [file] [log] [blame]
Guillaume Nodet6b2946d2009-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"
Guillaume Nodetf69382a2009-09-09 11:41:44 +000021 xmlns:cm="http://geronimo.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
22 xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
23
24 <!-- Allow the use of system properties -->
Guillaume Nodetbb42a9c2009-09-09 12:07:26 +000025 <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
Guillaume Nodet6b2946d2009-06-18 20:57:23 +000026
27 <!-- Property place holder -->
28 <cm:property-placeholder persistent-id="org.apache.felix.karaf.management">
29 <cm:default-properties>
30 <cm:property name="rmiRegistryPort" value="1099"/>
31 <cm:property name="jmxRealm" value="karaf"/>
Guillaume Nodetbb42a9c2009-09-09 12:07:26 +000032 <cm:property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-$[karaf.name]"/>
Guillaume Nodet6b2946d2009-06-18 20:57:23 +000033 <cm:property name="daemon" value="true"/>
34 <cm:property name="threaded" value="true"/>
35 <cm:property name="objectName" value="connector:name=rmi"/>
36 </cm:default-properties>
37 </cm:property-placeholder>
38
39 <!-- MBeanServer bean -->
Guillaume Nodetf69382a2009-09-09 11:41:44 +000040 <bean id="mbeanServerFactory" class="org.apache.felix.karaf.management.MBeanServerFactory" init-method="init"
41 destroy-method="destroy" depends-on="rmiRegistryFactory">
Guillaume Nodet6b2946d2009-06-18 20:57:23 +000042 <property name="locateExistingServerIfPossible" value="true"/>
43 </bean>
44 <bean id="mbeanServer" factory-ref="mbeanServerFactory" factory-method="getServer"/>
45
46 <!-- Export the MBeanServer as an OSGi service -->
47 <service ref="mbeanServer" interface="javax.management.MBeanServer"/>
48
49 <!-- Create a RMI registry -->
Guillaume Nodetf69382a2009-09-09 11:41:44 +000050 <bean id="rmiRegistryFactory" class="org.apache.felix.karaf.management.RmiRegistryFactory" init-method="init"
51 destroy-method="destroy">
Guillaume Nodet6b2946d2009-06-18 20:57:23 +000052 <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 -->
Guillaume Nodetf69382a2009-09-09 11:41:44 +000058 <bean id="connectorFactory" class="org.apache.felix.karaf.management.ConnectorServerFactory" init-method="init"
59 destroy-method="destroy">
Guillaume Nodet6b2946d2009-06-18 20:57:23 +000060 <property name="server" ref="mbeanServer"/>
61 <property name="serviceUrl" value="${serviceUrl}"/>
62 <property name="daemon" value="${daemon}"/>
63 <property name="threaded" value="${threaded}"/>
64 <property name="objectName" value="${objectName}"/>
65 <property name="environment">
66 <map>
67 <entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator"/>
68 </map>
69 </property>
70 </bean>
71
72 <!-- JAAS authenticator -->
73 <bean id="jaasAuthenticator" class="org.apache.felix.karaf.management.JaasAuthenticator">
74 <property name="realm" value="${jmxRealm}"/>
75 </bean>
76
77</blueprint>
78