blob: 49294b9e05e24918e6a52eb693a9c62cca102988 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
<!-- Allow the use of system properties -->
<ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
<!-- Property place holder -->
<cm:property-placeholder persistent-id="org.apache.felix.karaf.management">
<cm:default-properties>
<cm:property name="rmiRegistryPort" value="1099"/>
<cm:property name="jmxRealm" value="karaf"/>
<cm:property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-$[karaf.name]"/>
<cm:property name="daemon" value="true"/>
<cm:property name="threaded" value="true"/>
<cm:property name="objectName" value="connector:name=rmi"/>
</cm:default-properties>
</cm:property-placeholder>
<!-- MBeanServer bean -->
<bean id="mbeanServerFactory" class="org.apache.felix.karaf.management.MBeanServerFactory" init-method="init"
destroy-method="destroy" depends-on="rmiRegistryFactory">
<property name="locateExistingServerIfPossible" value="true"/>
</bean>
<bean id="mbeanServer" factory-ref="mbeanServerFactory" factory-method="getServer"/>
<!-- Export the MBeanServer as an OSGi service -->
<service ref="mbeanServer" interface="javax.management.MBeanServer"/>
<!-- Create a RMI registry -->
<bean id="rmiRegistryFactory" class="org.apache.felix.karaf.management.RmiRegistryFactory" init-method="init"
destroy-method="destroy">
<property name="create" value="true"/>
<property name="locate" value="true"/>
<property name="port" value="${rmiRegistryPort}"/>
</bean>
<!-- Create a JMX connector ServiceFactory -->
<bean id="connectorFactory" class="org.apache.felix.karaf.management.ConnectorServerFactory" init-method="init"
destroy-method="destroy">
<property name="server" ref="mbeanServer"/>
<property name="serviceUrl" value="${serviceUrl}"/>
<property name="daemon" value="${daemon}"/>
<property name="threaded" value="${threaded}"/>
<property name="objectName" value="${objectName}"/>
<property name="environment">
<map>
<entry key="jmx.remote.authenticator" value-ref="jaasAuthenticator"/>
</map>
</property>
</bean>
<!-- JAAS authenticator -->
<bean id="jaasAuthenticator" class="org.apache.felix.karaf.management.JaasAuthenticator">
<property name="realm" value="${jmxRealm}"/>
</bean>
</blueprint>