Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 1 | <?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 Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 39 | <bean id="mbeanServerFactory" class="org.apache.felix.karaf.management.MBeanServerFactory" init-method="init" destroy-method="destroy">
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 40 | <property name="locateExistingServerIfPossible" value="true"/>
|
| 41 | </bean>
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 42 | <bean id="mbeanServer" factory-bean="mbeanServerFactory" factory-method="getServer">
|
| 43 | </bean>
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 44 |
|
| 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 Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 53 | <bean id="rmiRegistryFactory" class="org.apache.felix.karaf.management.RmiRegistryFactory" init-method="init" destroy-method="destroy">
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 54 | <property name="create" value="true" />
|
| 55 | <property name="locate" value="true" />
|
| 56 | <property name="port" value="${rmiRegistryPort}" />
|
| 57 | </bean>
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 58 | <bean id="rmiRegistry" factory-bean="rmiRegistryFactory" factory-method="getObject"/>
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 59 |
|
| 60 | <!-- Create a JMX connector ServiceFactory -->
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 61 | <bean id="jmxConnectorServiceFactory" class="org.apache.felix.karaf.management.ConnectorServerFactory" init-method="init" destroy-method="destroy">
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 62 | <property name="server" ref="mbeanServer" />
|
| 63 | <property name="serviceUrl" value="${serviceUrl}" />
|
| 64 | <property name="daemon" value="${daemon}" />
|
| 65 | <property name="threaded" value="${threaded}" />
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 66 | <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 Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 76 | </bean>
|
| 77 |
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 78 | <!-- JAAS authenticator -->
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 79 | <bean id="jaasAuthenticator" class="org.apache.felix.karaf.management.JaasAuthenticator">
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 80 | <property name="realm" value="${jmxRealm}" />
|
| 81 | </bean>
|
| 82 |
|
| 83 | <!-- Property place holder -->
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 84 | <osgix:cm-properties id="cmProps" persistent-id="org.apache.felix.karaf.management">
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 85 | <prop key="rmiRegistryPort">1099</prop>
|
Guillaume Nodet | 25ec8f1 | 2009-05-04 06:59:07 +0000 | [diff] [blame] | 86 | <prop key="jmxRealm">karaf</prop>
|
Guillaume Nodet | 05fac96 | 2009-04-27 10:01:58 +0000 | [diff] [blame] | 87 | <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 |
|