OSGI-INF.blueprint.karaf-management.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.karaf.management Show documentation
Show all versions of org.apache.karaf.management Show documentation
This bundle starts the Karaf embedded MBean server and RMI registry allowing users
to use JMX to manage Karaf.
<?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.1.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="]"> <ext:default-properties> <ext:property name="karaf.admin.role" value="admin" /> </ext:default-properties> </ext:property-placeholder> <!-- Property place holder --> <cm:property-placeholder persistent-id="org.apache.karaf.management" update-strategy="reload"> <cm:default-properties> <cm:property name="rmiRegistryPort" value="1099"/> <cm:property name="rmiServerPort" value="44444"/> <cm:property name="jmxRealm" value="karaf"/> <cm:property name="jmxRole" value="$[karaf.admin.role]"/> <cm:property name="serviceUrl" value="service:jmx:rmi://localhost:44444/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.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.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.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.karaf.management.JaasAuthenticator"> <property name="realm" value="${jmxRealm}"/> <property name="role" value="${jmxRole}"/> </bean> </blueprint>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy