blob: 018255d8df5507ab8f659252e0d437c4c2420f62 [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"
21 xmlns:ext="http://geronimo.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">
22
23 <ext:property-placeholder placeholder-prefix="$(" placeholder-suffix=")"/>
24
25 <ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]" ignore-missing-locations="true">
26 <ext:default-properties>
27 <ext:property name="featuresRepositories" value=""/>
28 <ext:property name="featuresBoot" value=""/>
29 </ext:default-properties>
30 <ext:location>file:$(karaf.home)/etc/org.apache.felix.karaf.features.cfg</ext:location>
31 </ext:property-placeholder>
32
33 <command-bundle xmlns="http://felix.apache.org/karaf/xmlns/gshell/v1.0.0">
34 <command name="features/addUrl">
35 <action class="org.apache.felix.karaf.gshell.features.commands.AddUrlCommand">
36 <property name="bundleContext" ref="blueprintBundleContext"/>
37 </action>
38 </command>
39 <command name="features/listUrl">
40 <action class="org.apache.felix.karaf.gshell.features.commands.ListUrlCommand">
41 <property name="bundleContext" ref="blueprintBundleContext"/>
42 </action>
43 </command>
44 <command name="features/removeUrl">
45 <action class="org.apache.felix.karaf.gshell.features.commands.RemoveUrlCommand">
46 <property name="bundleContext" ref="blueprintBundleContext"/>
47 </action>
48 <completers>
49 <ref component-id="removeUrlCompleter" />
50 </completers>
51 </command>
52 <command name="features/refreshUrl">
53 <action class="org.apache.felix.karaf.gshell.features.commands.RefreshUrlCommand">
54 <property name="bundleContext" ref="blueprintBundleContext"/>
55 </action>
56 </command>
57 <command name="features/install">
58 <action class="org.apache.felix.karaf.gshell.features.commands.InstallFeatureCommand">
59 <property name="bundleContext" ref="blueprintBundleContext"/>
60 </action>
61 <completers>
62 <ref component-id="installFeatureCompleter" />
63 </completers>
64 </command>
65 <command name="features/uninstall">
66 <action class="org.apache.felix.karaf.gshell.features.commands.UninstallFeatureCommand">
67 <property name="bundleContext" ref="blueprintBundleContext"/>
68 </action>
69 <completers>
70 <ref component-id="uninstallFeatureCompleter" />
71 </completers>
72 </command>
73 <command name="features/list">
74 <action class="org.apache.felix.karaf.gshell.features.commands.ListFeaturesCommand">
75 <property name="bundleContext" ref="blueprintBundleContext"/>
76 </action>
77 </command>
78 </command-bundle>
79
80 <bean id="featuresService" class="org.apache.felix.karaf.gshell.features.internal.FeaturesServiceImpl" init-method="start" destroy-method="stop">
81 <property name="urls" value="$[featuresRepositories]" />
82 <property name="boot" value="$[featuresBoot]" />
83 <property name="configAdmin" ref="configAdmin" />
84 <property name="preferences" ref="preferences" />
85 <property name="featuresServiceRegistry" ref="featureServiceRegistry" />
86 <property name="bundleContext" ref="blueprintBundleContext" />
87 </bean>
88
89 <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
90
91 <reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" availability="optional"/>
92
93 <service ref="featuresService" interface="org.apache.felix.karaf.gshell.features.FeaturesService" />
94
95 <bean id="installFeatureCompleter" class="org.apache.felix.karaf.gshell.features.completers.AvailableFeatureCompleter">
96 <property name="featuresRegistry" ref="featureServiceRegistry" />
97 </bean>
98
99 <bean id="uninstallFeatureCompleter" class="org.apache.felix.karaf.gshell.features.completers.InstalledFeatureCompleter">
100 <property name="featuresRegistry" ref="featureServiceRegistry" />
101 </bean>
102
103 <bean id="removeUrlCompleter" class="org.apache.felix.karaf.gshell.features.completers.FeatureRepositoryCompleter">
104 <property name="featuresRegistry" ref="featureServiceRegistry" />
105 </bean>
106
107 <!-- Management -->
108
109 <bean id="namingStrategy" class="org.apache.felix.karaf.gshell.features.management.DefaultNamingStrategy">
110 <property name="jmxDomainName" value="org.apache.felix.karaf" />
111 </bean>
112
113 <bean id="managementAgent" class="org.apache.felix.karaf.gshell.features.management.ManagementAgent" destroy-method="destroy">
114 <property name="mbeanServer" ref="mbeanServer" />
115 </bean>
116
117 <bean id="featureServiceRegistry" class="org.apache.felix.karaf.gshell.features.management.ManagedFeaturesRegistry" init-method="init">
118 <property name="managementAgent" ref="managementAgent" />
119 <property name="namingStrategy" ref="namingStrategy" />
120 </bean>
121
122 <reference id="mbeanServer" interface="javax.management.MBeanServer" availability="optional">
123 <listener ref="featureServiceRegistry" bind-method="registerMBeanServer" unbind-method="unregisterMBeanServer"/>
124 </reference>
125
126</blueprint>