blob: d45b6be9ad7d049bbcf453d29ac194626a5b011c [file] [log] [blame]
Guillaume Nodet05fac962009-04-27 10:01:58 +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<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 xmlns:gshell="http://servicemix.apache.org/schema/servicemix-gshell"
27 xsi:schemaLocation="
28 http://www.springframework.org/schema/beans
29 http://www.springframework.org/schema/beans/spring-beans.xsd
30 http://www.springframework.org/schema/context
31 http://www.springframework.org/schema/context/spring-context.xsd
32 http://www.springframework.org/schema/osgi
33 http://www.springframework.org/schema/osgi/spring-osgi.xsd
34 http://www.springframework.org/schema/osgi-compendium
35 http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
36 http://www.springframework.org/schema/util
37 http://www.springframework.org/schema/util/spring-util.xsd
38 http://servicemix.apache.org/schema/servicemix-gshell
39 http://servicemix.apache.org/schema/servicemix-gshell/servicemix-gshell.xsd">
40
41 <import resource="classpath:org/apache/servicemix/kernel/gshell/core/commands.xml" />
42
43 <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
44 <property name="location" value="file:${servicemix.home}/etc/org.apache.servicemix.features.cfg"/>
45 </bean>
46
47 <gshell:command-bundle>
48 <gshell:command name="features/addUrl">
49 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.AddUrlCommand" />
50 </gshell:command>
51 <gshell:command name="features/listUrl">
52 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListUrlCommand" />
53 </gshell:command>
54 <gshell:command name="features/removeUrl">
55 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RemoveUrlCommand" />
56 <gshell:completers>
57 <ref bean="removeUrlCompleter" />
58 </gshell:completers>
59 </gshell:command>
60 <gshell:command name="features/refreshUrl">
61 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.RefreshUrlCommand" />
62 </gshell:command>
63 <gshell:command name="features/install">
64 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.InstallFeatureCommand" />
65 <gshell:completers>
66 <ref bean="installFeatureCompleter" />
67 </gshell:completers>
68 </gshell:command>
69 <gshell:command name="features/uninstall">
70 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.UninstallFeatureCommand" />
71 <gshell:completers>
72 <ref bean="uninstallFeatureCompleter" />
73 </gshell:completers>
74 </gshell:command>
75 <gshell:command name="features/list">
76 <gshell:action class="org.apache.servicemix.kernel.gshell.features.commands.ListFeaturesCommand" />
77 </gshell:command>
78 </gshell:command-bundle>
79
80 <bean id="featuresService" class="org.apache.servicemix.kernel.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 </bean>
87
88 <bean id="featureDeploymentListener" class="org.apache.servicemix.kernel.gshell.features.internal.FeatureDeploymentListener">
89 <property name="featuresService" ref="featuresService" />
90 </bean>
91
92 <bean id="namingStrategy" class="org.apache.servicemix.kernel.gshell.features.management.DefaultNamingStrategy">
93 <property name="jmxDomainName" value="org.apache.servicemix" />
94 </bean>
95
96 <bean id="managementAgent" class="org.apache.servicemix.kernel.gshell.features.management.ManagementAgent">
97 <property name="mbeanServer" ref="mbeanServer" />
98 </bean>
99
100 <bean id="featureServiceRegistry" class="org.apache.servicemix.kernel.gshell.features.management.ManagedFeaturesRegistry">
101 <property name="managementAgent" ref="managementAgent" />
102 <property name="namingStrategy" ref="namingStrategy" />
103 <property name="featuresService" ref="featuresService" />
104 </bean>
105
106 <osgi:reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
107
108 <osgi:reference id="preferences" interface="org.osgi.service.prefs.PreferencesService" cardinality="0..1" />
109
110 <osgi:service ref="featuresService" interface="org.apache.servicemix.kernel.gshell.features.FeaturesService" />
111
112 <osgi:service ref="featureDeploymentListener" interface="org.apache.servicemix.kernel.filemonitor.DeploymentListener" />
113
114 <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.features">
115 <prop key="featuresRepositories"></prop>
116 <prop key="featuresBoot"></prop>
117 </osgix:cm-properties>
118
119 <!-- <ctx:property-placeholder properties-ref="cmProps" /> -->
120
121 <osgi:reference id="mbeanServer"
122 interface="javax.management.MBeanServer"
123 cardinality="0..1" >
124 <osgi:listener ref="featureServiceRegistry" bind-method="registerMBeanServer" />
125 </osgi:reference>
126
127 <bean id="installFeatureCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.AvailableFeatureCompleter">
128 <property name="featuresRegistry" ref="featureServiceRegistry" />
129 </bean>
130
131 <bean id="uninstallFeatureCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.InstalledFeatureCompleter">
132 <property name="featuresRegistry" ref="featureServiceRegistry" />
133 </bean>
134
135 <bean id="removeUrlCompleter" class="org.apache.servicemix.kernel.gshell.features.completers.FeatureRepositoryCompleter">
136 <property name="featuresRegistry" ref="featureServiceRegistry" />
137 </bean>
138
139</beans>