Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[maven-release-plugin] copy for tag karaf-2.2.4

git-svn-id: https://svn.apache.org/repos/asf/karaf/tags/karaf-2.2.4@1182765 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 6342ae4d4ab3785b6476da2f49e0be8bd15d233e 2 parents 4103c44 + 996d8cc
authored October 13, 2011

Showing 15 changed files with 597 additions and 274 deletions. Show diff stats Hide diff stats

  1. 3  RELEASE-NOTES
  2. 28  assemblies/features/standard/src/main/resources/features.xml
  3. 9  deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
  4. 4  features/core/src/main/java/org/apache/karaf/features/Feature.java
  5. 9  features/core/src/main/java/org/apache/karaf/features/internal/FeatureImpl.java
  6. 5  features/core/src/main/java/org/apache/karaf/features/internal/RepositoryImpl.java
  7. 452  features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd
  8. 6  jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
  9. 6  jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
  10. 20  management/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/BundlesMBean.java
  11. 123  ...ment/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/internal/BundlesMBeanImpl.java
  12. 169  ...ement/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/internal/BundlesSelector.java
  13. 20  management/mbeans/config/src/main/java/org/apache/karaf/management/mbeans/config/internal/ConfigMBeanImpl.java
  14. 14  tooling/features-maven-plugin/src/main/java/org/apache/karaf/tooling/features/AddFeaturesToRepoMojo.java
  15. 3  webconsole/features/src/main/java/org/apache/karaf/webconsole/features/ExtendedFeature.java
3  RELEASE-NOTES
@@ -51,6 +51,8 @@
51 51
     * [KARAF-921] - maven eclipse plugin 2.8 does not work correctly with karaf
52 52
     * [KARAF-922] - features-maven-plugin ignores repository tags in feature files
53 53
     * [KARAF-923] - features-maven-plugin#AddFeaturesToRepoMojo does not handle spaces in repository urls well
  54
+    * [KARAF-929] - MBean bundles should be seen as system bundles
  55
+    * [KARAF-932] - ConfigMBean raise a NPE when dictionnary is null
54 56
 
55 57
 ** Dependency upgrade
56 58
     * [KARAF-901] - Upgrade to Pax Web 1.0.7
@@ -71,6 +73,7 @@
71 73
     * [KARAF-900] - Shutdown command should display the instance name
72 74
     * [KARAF-907] - Include 64 bits wrapper library
73 75
     * [KARAF-925] - Karaf config.properties doesn't define J2SE-1.6 and J2SE-1.7 execution environment
  76
+    * [KARAF-930] - Bundles MBean should mimic the BundleSelector like osgi:* commands
74 77
 
75 78
 ** New Feature
76 79
     * [KARAF-541] - Support JMX SSL via etc/org.apache.karaf.management.cfg 
28  assemblies/features/standard/src/main/resources/features.xml
@@ -145,7 +145,7 @@
145 145
         <bundle>mvn:org.ops4j.pax.url/pax-url-obr/${pax.url.version}</bundle>
146 146
     </feature>
147 147
     <feature name="config" version="${project.version}">
148  
-        <bundle start-level='30'>mvn:org.apache.karaf.shell/org.apache.karaf.shell.config/${project.version}</bundle>
  148
+        <bundle start-level="30">mvn:org.apache.karaf.shell/org.apache.karaf.shell.config/${project.version}</bundle>
149 149
     </feature>
150 150
     <feature name="jetty" version="${jetty.version}" resolver="(obr)">
151 151
         <bundle dependency='true'>mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/${geronimo.activation.version}</bundle>
@@ -220,21 +220,21 @@
220 220
             sshRealm=karaf
221 221
             hostKey=${karaf.base}/etc/host.key
222 222
         </config>
223  
-        <bundle dependency='true'>mvn:org.apache.mina/mina-core/${mina.version}</bundle>
224  
-        <bundle dependency='true'>mvn:org.apache.sshd/sshd-core/${sshd.version}</bundle>
225  
-        <bundle>mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version}</bundle>
  223
+        <bundle start-level="30" dependency='true'>mvn:org.apache.mina/mina-core/${mina.version}</bundle>
  224
+        <bundle start-level="30" dependency='true'>mvn:org.apache.sshd/sshd-core/${sshd.version}</bundle>
  225
+        <bundle start-level="30">mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version}</bundle>
226 226
     </feature>
227 227
     <feature name="management" version="${project.version}">
228  
-        <bundle>mvn:org.apache.karaf.management/org.apache.karaf.management.server/${project.version}</bundle>
229  
-        <bundle>mvn:org.apache.aries.jmx/org.apache.aries.jmx/${aries.jmx.version}</bundle>
230  
-        <bundle>mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint/${aries.jmx.version}</bundle>
231  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.system/${project.version}</bundle>
232  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.bundles/${project.version}</bundle>
233  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.services/${project.version}</bundle>
234  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.config/${project.version}</bundle>
235  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.log/${project.version}</bundle>
236  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.packages/${project.version}</bundle>
237  
-        <bundle>mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.dev/${project.version}</bundle>
  228
+        <bundle start-level="30">mvn:org.apache.karaf.management/org.apache.karaf.management.server/${project.version}</bundle>
  229
+        <bundle start-level="30">mvn:org.apache.aries.jmx/org.apache.aries.jmx/${aries.jmx.version}</bundle>
  230
+        <bundle start-level="30">mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint/${aries.jmx.version}</bundle>
  231
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.system/${project.version}</bundle>
  232
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.bundles/${project.version}</bundle>
  233
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.services/${project.version}</bundle>
  234
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.config/${project.version}</bundle>
  235
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.log/${project.version}</bundle>
  236
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.packages/${project.version}</bundle>
  237
+        <bundle start-level="30">mvn:org.apache.karaf.management.mbeans/org.apache.karaf.management.mbeans.dev/${project.version}</bundle>
238 238
     </feature>
239 239
     <feature name="eventadmin" version="${project.version}">
240 240
 		<bundle start-level='30'>mvn:org.apache.felix/org.apache.felix.eventadmin/${felix.eventadmin.version}</bundle>
9  deployer/features/src/main/java/org/apache/karaf/deployer/features/FeatureDeploymentListener.java
@@ -28,6 +28,7 @@
28 28
 import javax.xml.parsers.DocumentBuilder;
29 29
 import javax.xml.parsers.DocumentBuilderFactory;
30 30
 
  31
+import org.apache.karaf.features.internal.FeatureImpl;
31 32
 import org.slf4j.Logger;
32 33
 import org.slf4j.LoggerFactory;
33 34
 import org.w3c.dom.Document;
@@ -130,7 +131,13 @@ public void bundleChanged(BundleEvent bundleEvent) {
130 131
                             for (Repository repo : featuresService.listRepositories()) {
131 132
                                 if (repo.getURI().equals(url.toURI())) {
132 133
                                     Set<Feature> features = new HashSet<Feature>(Arrays.asList(repo.getFeatures()));
133  
-                                    featuresService.installFeatures(features, EnumSet.noneOf(FeaturesService.Option.class));
  134
+                                    Set<Feature> autoInstallFeatures = new HashSet<Feature>();
  135
+                                    for(Feature feature:features) {
  136
+                                        if(feature.getInstall().equals(Feature.DEFAULT_INSTALL_MODE)){
  137
+                                            autoInstallFeatures.add(feature);
  138
+                                        }
  139
+                                    }
  140
+                                    featuresService.installFeatures(autoInstallFeatures, EnumSet.noneOf(FeaturesService.Option.class));
134 141
                                 }
135 142
                             }
136 143
                             urls.add(url);
4  features/core/src/main/java/org/apache/karaf/features/Feature.java
@@ -24,6 +24,8 @@
24 24
  */
25 25
 public interface Feature {
26 26
 
  27
+    public static String DEFAULT_INSTALL_MODE = "auto";
  28
+
27 29
     String getId();
28 30
 
29 31
     String getName();
@@ -36,6 +38,8 @@
36 38
 
37 39
     String getResolver();
38 40
 
  41
+    String getInstall();
  42
+
39 43
     List<Feature> getDependencies();
40 44
 
41 45
     List<BundleInfo> getBundles();
9  features/core/src/main/java/org/apache/karaf/features/internal/FeatureImpl.java
@@ -36,6 +36,7 @@
36 36
     private String details;
37 37
     private String version;
38 38
     private String resolver;
  39
+    private String install = DEFAULT_INSTALL_MODE;
39 40
     private List<Feature> dependencies = new ArrayList<Feature>();
40 41
     private List<BundleInfo> bundles = new ArrayList<BundleInfo>();
41 42
     private Map<String, Map<String,String>> configs = new HashMap<String, Map<String,String>>();
@@ -97,6 +98,14 @@ public void setResolver(String resolver) {
97 98
         this.resolver = resolver;
98 99
     }
99 100
 
  101
+    public String getInstall() {
  102
+        return install;
  103
+    }
  104
+
  105
+    public void setInstall(String install) {
  106
+        this.install = install;
  107
+    }
  108
+
100 109
     public List<Feature> getDependencies() {
101 110
         return dependencies;
102 111
     }
5  features/core/src/main/java/org/apache/karaf/features/internal/RepositoryImpl.java
@@ -136,6 +136,11 @@ public void load() throws IOException {
136 136
                         f.setResolver(resolver);
137 137
                     }
138 138
 
  139
+                    String install = e.getAttribute("install");
  140
+                    if (install != null && install.length() > 0) {
  141
+                        f.setInstall(install);
  142
+                    }
  143
+
139 144
                     String description = e.getAttribute("description");
140 145
                     if (description != null && description.length() > 0) {
141 146
                         f.setDescription(description);
452  features/core/src/main/resources/org/apache/karaf/features/karaf-features-1.0.0.xsd
... ...
@@ -1,216 +1,236 @@
1  
-<?xml version="1.0" encoding="UTF-8"?>
2  
-<!--
3  
-    Licensed to the Apache Software Foundation (ASF) under one or more
4  
-    contributor license agreements. See the NOTICE file distributed with
5  
-    this work for additional information regarding copyright ownership.
6  
-    The ASF licenses this file to You under the Apache License, Version 2.0
7  
-    (the "License"); you may not use this file except in compliance with
8  
-    the License. You may obtain a copy of the License at
9  
-
10  
-       http://www.apache.org/licenses/LICENSE-2.0
11  
-
12  
-    Unless required by applicable law or agreed to in writing, software
13  
-    distributed under the License is distributed on an "AS IS" BASIS,
14  
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  
-    See the License for the specific language governing permissions and
16  
-    limitations under the License.
17  
-
18  
--->
19  
-<xs:schema elementFormDefault="qualified"
20  
-    targetNamespace="http://karaf.apache.org/xmlns/features/v1.0.0"
21  
-    xmlns:tns="http://karaf.apache.org/xmlns/features/v1.0.0"
22  
-    xmlns:xs="http://www.w3.org/2001/XMLSchema">
23  
-
24  
-    <xs:annotation>
25  
-        <xs:documentation><![CDATA[
26  
-Karaf features mechanism. For documentation please visit 
27  
-<a href="http://karaf.apache.org/">Karaf website</a>.
28  
-        ]]></xs:documentation>
29  
-    </xs:annotation>
30  
-
31  
-    <xs:complexType name="features">
32  
-        <xs:annotation>
33  
-            <xs:documentation><![CDATA[
34  
-Root element of Feature definition. It contains optional attribute which allow
35  
-name of repository. This name will be used in shell to display source repository
36  
-of given feature.
37  
-            ]]></xs:documentation>
38  
-        </xs:annotation>
39  
-        <xs:choice minOccurs="0" maxOccurs="unbounded">
40  
-            <xs:element name="repository" type="xs:anyURI">
41  
-                <xs:annotation>
42  
-                    <xs:documentation><![CDATA[
43  
-Additional repositories where dependencies are stored.
44  
-                    ]]></xs:documentation>
45  
-                </xs:annotation>
46  
-            </xs:element>
47  
-            <xs:element name="feature" type="tns:feature">
48  
-                <xs:annotation>
49  
-                    <xs:documentation><![CDATA[
50  
-Feature definition.
51  
-                    ]]></xs:documentation>
52  
-                </xs:annotation>
53  
-            </xs:element>
54  
-        </xs:choice>
55  
-        <xs:attribute name="name" type="xs:string" />
56  
-    </xs:complexType>
57  
-
58  
-    <xs:complexType name="feature">
59  
-        <xs:annotation>
60  
-            <xs:documentation><![CDATA[
61  
-Definition of the Feature.
62  
-            ]]></xs:documentation>
63  
-        </xs:annotation>
64  
-        <xs:choice minOccurs="0" maxOccurs="unbounded">
65  
-            <xs:element name="details" minOccurs="0" type="xs:string">
66  
-                <xs:annotation>
67  
-                    <xs:documentation><![CDATA[
68  
-Long info displayed in features:info command result.
69  
-                    ]]>
70  
-                    </xs:documentation>
71  
-                </xs:annotation>
72  
-            </xs:element>
73  
-            <xs:element name="config" type="tns:config" />
74  
-            <xs:element name="configfile" type="tns:configFile" />
75  
-            <xs:element name="feature" type="tns:dependency" />
76  
-            <xs:element name="bundle" type="tns:bundle" />
77  
-        </xs:choice>
78  
-        <xs:attribute name="name" type="tns:featureName" use="required" />
79  
-        <xs:attribute name="version" type="xs:string" default="0.0.0" />
80  
-        <xs:attribute name="description" type="xs:string" />
81  
-        <xs:attribute name="resolver" type="tns:resolver">
82  
-            <xs:annotation>
83  
-                <xs:documentation><![CDATA[
84  
-Karaf allow using dynamic resolvers.
85  
-                ]]>
86  
-                </xs:documentation>
87  
-            </xs:annotation>
88  
-        </xs:attribute>
89  
-        <xs:attribute name="start-level" type="xs:int">
90  
-             <xs:annotation>
91  
-                <xs:documentation><![CDATA[
92  
-Bundles in this feature start level set to OSGi framework.
93  
-                ]]>
94  
-                </xs:documentation>
95  
-             </xs:annotation>
96  
-         </xs:attribute>
97  
-
98  
-    </xs:complexType>
99  
-
100  
-    <xs:complexType name="bundle">
101  
-        <xs:annotation>
102  
-            <xs:documentation><![CDATA[
103  
-Deployable element to install.
104  
-            ]]></xs:documentation>
105  
-        </xs:annotation>
106  
-        <xs:simpleContent>
107  
-            <xs:extension base="xs:anyURI">
108  
-                <xs:attribute name="start-level" type="xs:int">
109  
-                    <xs:annotation>
110  
-                        <xs:documentation><![CDATA[
111  
-Bundle start level set to OSGi framework.
112  
-                        ]]>
113  
-                        </xs:documentation>
114  
-                    </xs:annotation>
115  
-                </xs:attribute>
116  
-                <xs:attribute name="start" type="xs:boolean">
117  
-                    <xs:annotation>
118  
-                        <xs:documentation><![CDATA[
119  
-This switch allow you to leave bundle in resolved state.
120  
-                        ]]>
121  
-                        </xs:documentation>
122  
-                    </xs:annotation>
123  
-                </xs:attribute>
124  
-                <xs:attribute name="dependency" type="xs:boolean">
125  
-                    <xs:annotation>
126  
-                        <xs:documentation><![CDATA[
127  
-Mark bundle as dependency for resolver.
128  
-                        ]]>
129  
-                        </xs:documentation>
130  
-                    </xs:annotation>
131  
-                </xs:attribute>
132  
-            </xs:extension>
133  
-        </xs:simpleContent>
134  
-    </xs:complexType>
135  
-
136  
-    <xs:complexType name="dependency">
137  
-        <xs:annotation>
138  
-            <xs:documentation><![CDATA[
139  
-Dependency of feature.
140  
-            ]]></xs:documentation>
141  
-        </xs:annotation>
142  
-        <xs:simpleContent>
143  
-            <xs:extension base="tns:featureName">
144  
-                <xs:attribute name="version" type="xs:string" default="0.0.0" />
145  
-            </xs:extension>
146  
-        </xs:simpleContent>
147  
-    </xs:complexType>
148  
-
149  
-    <xs:complexType name="config">
150  
-        <xs:annotation>
151  
-            <xs:documentation><![CDATA[
152  
-Configuration entries which should be created during feature installation. This
153  
-configuration may be used with OSGi Configuration Admin.
154  
-            ]]></xs:documentation>
155  
-        </xs:annotation>
156  
-        <xs:simpleContent>
157  
-            <xs:extension base="xs:string">
158  
-                <xs:attribute name="name" type="xs:string" use="required" />
159  
-            </xs:extension>
160  
-        </xs:simpleContent>
161  
-    </xs:complexType>
162  
-
163  
-    <xs:complexType name="configFile">
164  
-        <xs:annotation>
165  
-            <xs:documentation><![CDATA[
166  
-Additional configuration files which should be created during feature installation.
167  
-            ]]></xs:documentation>
168  
-        </xs:annotation>
169  
-        <xs:simpleContent>
170  
-            <xs:extension base="xs:anyURI">
171  
-                <xs:attribute name="finalname" type="xs:string" use="required">
172  
-                    <xs:annotation>
173  
-                        <xs:documentation><![CDATA[
174  
-Name of file name where given deployable element should be stored.
175  
-                        ]]></xs:documentation>
176  
-                    </xs:annotation>
177  
-                </xs:attribute>
178  
-                <xs:attribute name="override" type="xs:boolean">
179  
-                    <xs:annotation>
180  
-                        <xs:documentation><![CDATA[
181  
-flag to specify if the finalname file should be overriden
182  
-                        ]]></xs:documentation>
183  
-                    </xs:annotation>
184  
-                </xs:attribute>
185  
-
186  
-            </xs:extension>
187  
-        </xs:simpleContent>
188  
-    </xs:complexType>
189  
-
190  
-    <xs:simpleType name="featureName">
191  
-        <xs:annotation>
192  
-            <xs:documentation><![CDATA[
193  
-Feature name should be non empty string.
194  
-            ]]></xs:documentation>
195  
-        </xs:annotation>
196  
-        <xs:restriction base="xs:string">
197  
-            <xs:minLength value="1" />
198  
-        </xs:restriction>
199  
-    </xs:simpleType>
200  
-
201  
-    <xs:simpleType name="resolver">
202  
-        <xs:annotation>
203  
-            <xs:documentation><![CDATA[
204  
-Resolver to use. Karaf will look for OSGi servie which have following properties:
205  
-objectClass: org.apache.karaf.features.Resolver
206  
-name: the value
207  
-            ]]></xs:documentation>
208  
-        </xs:annotation>
209  
-        <xs:restriction base="xs:string">
210  
-            <xs:minLength value="1" />
211  
-        </xs:restriction>
212  
-    </xs:simpleType>
213  
-
214  
-    <xs:element name="features" type="tns:features" />
215  
-
216  
-</xs:schema>
  1
+<?xml version="1.0" encoding="UTF-8"?>
  2
+<!--
  3
+    Licensed to the Apache Software Foundation (ASF) under one or more
  4
+    contributor license agreements. See the NOTICE file distributed with
  5
+    this work for additional information regarding copyright ownership.
  6
+    The ASF licenses this file to You under the Apache License, Version 2.0
  7
+    (the "License"); you may not use this file except in compliance with
  8
+    the License. You may obtain a copy of the License at
  9
+
  10
+       http://www.apache.org/licenses/LICENSE-2.0
  11
+
  12
+    Unless required by applicable law or agreed to in writing, software
  13
+    distributed under the License is distributed on an "AS IS" BASIS,
  14
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15
+    See the License for the specific language governing permissions and
  16
+    limitations under the License.
  17
+
  18
+-->
  19
+<xs:schema elementFormDefault="qualified"
  20
+    targetNamespace="http://karaf.apache.org/xmlns/features/v1.0.0"
  21
+    xmlns:tns="http://karaf.apache.org/xmlns/features/v1.0.0"
  22
+    xmlns:xs="http://www.w3.org/2001/XMLSchema">
  23
+
  24
+    <xs:annotation>
  25
+        <xs:documentation><![CDATA[
  26
+Karaf features mechanism. For documentation please visit 
  27
+<a href="http://karaf.apache.org/">Karaf website</a>.
  28
+        ]]></xs:documentation>
  29
+    </xs:annotation>
  30
+
  31
+    <xs:complexType name="features">
  32
+        <xs:annotation>
  33
+            <xs:documentation><![CDATA[
  34
+Root element of Feature definition. It contains optional attribute which allow
  35
+name of repository. This name will be used in shell to display source repository
  36
+of given feature.
  37
+            ]]></xs:documentation>
  38
+        </xs:annotation>
  39
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
  40
+            <xs:element name="repository" type="xs:anyURI">
  41
+                <xs:annotation>
  42
+                    <xs:documentation><![CDATA[
  43
+Additional repositories where dependencies are stored.
  44
+                    ]]></xs:documentation>
  45
+                </xs:annotation>
  46
+            </xs:element>
  47
+            <xs:element name="feature" type="tns:feature">
  48
+                <xs:annotation>
  49
+                    <xs:documentation><![CDATA[
  50
+Feature definition.
  51
+                    ]]></xs:documentation>
  52
+                </xs:annotation>
  53
+            </xs:element>
  54
+        </xs:choice>
  55
+        <xs:attribute name="name" type="xs:string" />
  56
+    </xs:complexType>
  57
+
  58
+    <xs:complexType name="feature">
  59
+        <xs:annotation>
  60
+            <xs:documentation><![CDATA[
  61
+Definition of the Feature.
  62
+            ]]></xs:documentation>
  63
+        </xs:annotation>
  64
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
  65
+            <xs:element name="details" minOccurs="0" type="xs:string">
  66
+                <xs:annotation>
  67
+                    <xs:documentation><![CDATA[
  68
+Long info displayed in features:info command result.
  69
+                    ]]>
  70
+                    </xs:documentation>
  71
+                </xs:annotation>
  72
+            </xs:element>
  73
+            <xs:element name="config" type="tns:config" />
  74
+            <xs:element name="configfile" type="tns:configFile" />
  75
+            <xs:element name="feature" type="tns:dependency" />
  76
+            <xs:element name="bundle" type="tns:bundle" />
  77
+        </xs:choice>
  78
+        <xs:attribute name="name" type="tns:featureName" use="required" />
  79
+        <xs:attribute name="version" type="xs:string" default="0.0.0" />
  80
+        <xs:attribute name="description" type="xs:string" />
  81
+        <xs:attribute name="resolver" type="tns:resolver">
  82
+            <xs:annotation>
  83
+                <xs:documentation><![CDATA[
  84
+Karaf allow using dynamic resolvers.
  85
+                ]]>
  86
+                </xs:documentation>
  87
+            </xs:annotation>
  88
+        </xs:attribute>
  89
+        <xs:attribute name="install" type="tns:install">
  90
+            <xs:annotation>
  91
+                <xs:documentation><![CDATA[
  92
+Marks if the feaute will be automatically started when thrown to the deploy folder.
  93
+                ]]>
  94
+                </xs:documentation>
  95
+            </xs:annotation>
  96
+        </xs:attribute>
  97
+        <xs:attribute name="start-level" type="xs:int">
  98
+             <xs:annotation>
  99
+                <xs:documentation><![CDATA[
  100
+Bundles in this feature start level set to OSGi framework.
  101
+                ]]>
  102
+                </xs:documentation>
  103
+             </xs:annotation>
  104
+         </xs:attribute>
  105
+
  106
+    </xs:complexType>
  107
+
  108
+    <xs:complexType name="bundle">
  109
+        <xs:annotation>
  110
+            <xs:documentation><![CDATA[
  111
+Deployable element to install.
  112
+            ]]></xs:documentation>
  113
+        </xs:annotation>
  114
+        <xs:simpleContent>
  115
+            <xs:extension base="xs:anyURI">
  116
+                <xs:attribute name="start-level" type="xs:int">
  117
+                    <xs:annotation>
  118
+                        <xs:documentation><![CDATA[
  119
+Bundle start level set to OSGi framework.
  120
+                        ]]>
  121
+                        </xs:documentation>
  122
+                    </xs:annotation>
  123
+                </xs:attribute>
  124
+                <xs:attribute name="start" type="xs:boolean">
  125
+                    <xs:annotation>
  126
+                        <xs:documentation><![CDATA[
  127
+This switch allow you to leave bundle in resolved state.
  128
+                        ]]>
  129
+                        </xs:documentation>
  130
+                    </xs:annotation>
  131
+                </xs:attribute>
  132
+                <xs:attribute name="dependency" type="xs:boolean">
  133
+                    <xs:annotation>
  134
+                        <xs:documentation><![CDATA[
  135
+Mark bundle as dependency for resolver.
  136
+                        ]]>
  137
+                        </xs:documentation>
  138
+                    </xs:annotation>
  139
+                </xs:attribute>
  140
+            </xs:extension>
  141
+        </xs:simpleContent>
  142
+    </xs:complexType>
  143
+
  144
+    <xs:complexType name="dependency">
  145
+        <xs:annotation>
  146
+            <xs:documentation><![CDATA[
  147
+Dependency of feature.
  148
+            ]]></xs:documentation>
  149
+        </xs:annotation>
  150
+        <xs:simpleContent>
  151
+            <xs:extension base="tns:featureName">
  152
+                <xs:attribute name="version" type="xs:string" default="0.0.0" />
  153
+            </xs:extension>
  154
+        </xs:simpleContent>
  155
+    </xs:complexType>
  156
+
  157
+    <xs:complexType name="config">
  158
+        <xs:annotation>
  159
+            <xs:documentation><![CDATA[
  160
+Configuration entries which should be created during feature installation. This
  161
+configuration may be used with OSGi Configuration Admin.
  162
+            ]]></xs:documentation>
  163
+        </xs:annotation>
  164
+        <xs:simpleContent>
  165
+            <xs:extension base="xs:string">
  166
+                <xs:attribute name="name" type="xs:string" use="required" />
  167
+            </xs:extension>
  168
+        </xs:simpleContent>
  169
+    </xs:complexType>
  170
+
  171
+    <xs:complexType name="configFile">
  172
+        <xs:annotation>
  173
+            <xs:documentation><![CDATA[
  174
+Additional configuration files which should be created during feature installation.
  175
+            ]]></xs:documentation>
  176
+        </xs:annotation>
  177
+        <xs:simpleContent>
  178
+            <xs:extension base="xs:anyURI">
  179
+                <xs:attribute name="finalname" type="xs:string" use="required">
  180
+                    <xs:annotation>
  181
+                        <xs:documentation><![CDATA[
  182
+Name of file name where given deployable element should be stored.
  183
+                        ]]></xs:documentation>
  184
+                    </xs:annotation>
  185
+                </xs:attribute>
  186
+                <xs:attribute name="override" type="xs:boolean">
  187
+                    <xs:annotation>
  188
+                        <xs:documentation><![CDATA[
  189
+flag to specify if the finalname file should be overriden
  190
+                        ]]></xs:documentation>
  191
+                    </xs:annotation>
  192
+                </xs:attribute>
  193
+
  194
+            </xs:extension>
  195
+        </xs:simpleContent>
  196
+    </xs:complexType>
  197
+
  198
+    <xs:simpleType name="featureName">
  199
+        <xs:annotation>
  200
+            <xs:documentation><![CDATA[
  201
+Feature name should be non empty string.
  202
+            ]]></xs:documentation>
  203
+        </xs:annotation>
  204
+        <xs:restriction base="xs:string">
  205
+            <xs:minLength value="1" />
  206
+        </xs:restriction>
  207
+    </xs:simpleType>
  208
+
  209
+    <xs:simpleType name="resolver">
  210
+        <xs:annotation>
  211
+            <xs:documentation><![CDATA[
  212
+Resolver to use. Karaf will look for OSGi servie which have following properties:
  213
+objectClass: org.apache.karaf.features.Resolver
  214
+name: the value
  215
+            ]]></xs:documentation>
  216
+        </xs:annotation>
  217
+        <xs:restriction base="xs:string">
  218
+            <xs:minLength value="1" />
  219
+        </xs:restriction>
  220
+    </xs:simpleType>
  221
+    <xs:simpleType name="install">
  222
+        <xs:annotation>
  223
+            <xs:documentation><![CDATA[
  224
+Installation mode. Can be either manual or auto. Specifies wether the feature should be automatically installed when
  225
+dropped inside the deploy folder. Note: This attribute doesn't affect feature descriptors that are installed from the
  226
+command line or as part of the org.apache.karaf.features.cfg.
  227
+            ]]></xs:documentation>
  228
+        </xs:annotation>
  229
+        <xs:restriction base="xs:string">
  230
+            <xs:minLength value="1" />
  231
+        </xs:restriction>
  232
+    </xs:simpleType>
  233
+
  234
+    <xs:element name="features" type="tns:features" />
  235
+
  236
+</xs:schema>
6  jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
@@ -81,6 +81,12 @@ public void addUser(String username, String password) {
81 81
         //If encryption support is enabled, encrypt password
82 82
         if (encryptionSupport != null && encryptionSupport.getEncryption() != null) {
83 83
             newPassword = encryptionSupport.getEncryption().encryptPassword(password);
  84
+            if (encryptionSupport.getEncryptionPrefix() != null) {
  85
+                newPassword = encryptionSupport.getEncryptionPrefix() + newPassword;
  86
+            }
  87
+            if (encryptionSupport.getEncryptionSuffix() != null) {
  88
+                newPassword = newPassword + encryptionSupport.getEncryptionSuffix();
  89
+            }
84 90
         }
85 91
 
86 92
         if (dataSource != null) {
6  jaas/modules/src/main/java/org/apache/karaf/jaas/modules/properties/PropertiesBackingEngine.java
@@ -67,6 +67,12 @@ public void addUser(String username, String password) {
67 67
         //If encryption support is enabled, encrypt password
68 68
         if (encryptionSupport != null && encryptionSupport.getEncryption() != null) {
69 69
             newPassword = encryptionSupport.getEncryption().encryptPassword(password);
  70
+            if (encryptionSupport.getEncryptionPrefix() != null) {
  71
+                newPassword = encryptionSupport.getEncryptionPrefix() + newPassword;
  72
+            }
  73
+            if (encryptionSupport.getEncryptionSuffix() != null) {
  74
+                newPassword = newPassword + encryptionSupport.getEncryptionSuffix();
  75
+            }
70 76
         }
71 77
 
72 78
         String userInfos = users.get(username);
20  management/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/BundlesMBean.java
@@ -25,27 +25,27 @@
25 25
 
26 26
     TabularData list() throws Exception;
27 27
 
28  
-    int getStartLevel(long bundleId) throws Exception;
29  
-    void setStartLevel(long bundleId, int bundleStartLevel) throws Exception;
  28
+    int getStartLevel(String bundleId) throws Exception;
  29
+    void setStartLevel(String bundleId, int bundleStartLevel) throws Exception;
30 30
 
31 31
     void refresh() throws Exception;
32  
-    void refresh(long bundleId) throws Exception;
  32
+    void refresh(String bundleId) throws Exception;
33 33
 
34  
-    void update(long bundleId) throws Exception;
35  
-    void update(long bundleId, String location) throws Exception;
  34
+    void update(String bundleId) throws Exception;
  35
+    void update(String bundleId, String location) throws Exception;
36 36
 
37 37
     void resolve() throws Exception;
38  
-    void resolve(long bundleId) throws Exception;
  38
+    void resolve(String bundleId) throws Exception;
39 39
 
40  
-    void restart(long bundleId) throws Exception;
  40
+    void restart(String bundleId) throws Exception;
41 41
 
42 42
     long install(String url) throws Exception;
43 43
     long install(String url, boolean start) throws Exception;
44 44
 
45  
-    void start(long bundleId) throws Exception;
  45
+    void start(String bundleId) throws Exception;
46 46
 
47  
-    void stop(long bundleId) throws Exception;
  47
+    void stop(String bundleId) throws Exception;
48 48
 
49  
-    void uninstall(long bundleId) throws Exception;
  49
+    void uninstall(String bundleId) throws Exception;
50 50
 
51 51
 }
123  ...t/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/internal/BundlesMBeanImpl.java
@@ -28,6 +28,7 @@
28 28
 import javax.management.openmbean.*;
29 29
 import java.io.InputStream;
30 30
 import java.net.URL;
  31
+import java.util.List;
31 32
 
32 33
 /**
33 34
  * Bundles MBean implementation.
@@ -50,7 +51,7 @@ public TabularData list() throws Exception {
50 51
         CompositeType bundleType = new CompositeType("Bundle", "OSGi Bundle",
51 52
                 new String[]{ "ID", "Name", "Version", "Start Level", "State" },
52 53
                 new String[]{ "ID of the Bundle", "Name of the Bundle", "Version of the Bundle", "Start Level of the Bundle", "Current State of the Bundle" },
53  
-                new OpenType[]{ SimpleType.LONG, SimpleType.STRING, SimpleType.STRING, SimpleType.INTEGER, SimpleType.INTEGER });
  54
+                new OpenType[]{ SimpleType.LONG, SimpleType.STRING, SimpleType.STRING, SimpleType.INTEGER, SimpleType.STRING });
54 55
         TabularType tableType = new TabularType("Bundles", "Tables of all Bundles", bundleType, new String[]{ "ID" });
55 56
         TabularData table = new TabularDataSupport(tableType);
56 57
 
@@ -61,9 +62,22 @@ public TabularData list() throws Exception {
61 62
             if (startLevel != null) {
62 63
                 bundleStartLevel = startLevel.getBundleStartLevel(bundles[i]);
63 64
             }
  65
+            int bundleState = bundles[i].getState();
  66
+            String bundleStateString;
  67
+            if (bundleState == Bundle.ACTIVE)
  68
+                bundleStateString = "ACTIVE";
  69
+            else if (bundleState == Bundle.INSTALLED)
  70
+                bundleStateString = "INSTALLED";
  71
+            else if (bundleState == Bundle.RESOLVED)
  72
+                bundleStateString = "RESOLVED";
  73
+            else if (bundleState == Bundle.STARTING)
  74
+                bundleStateString = "STARTING";
  75
+            else if (bundleState == Bundle.STOPPING)
  76
+                bundleStateString = "STOPPING";
  77
+            else bundleStateString = "UNKNOWN";
64 78
             CompositeData data = new CompositeDataSupport(bundleType,
65 79
                     new String[]{ "ID", "Name", "Version", "Start Level", "State" },
66  
-                    new Object[]{ bundles[i].getBundleId(), bundles[i].getSymbolicName(), bundles[i].getVersion().toString(), bundleStartLevel, bundles[i].getState() });
  80
+                    new Object[]{ bundles[i].getBundleId(), bundles[i].getSymbolicName(), bundles[i].getVersion().toString(), bundleStartLevel, bundleStateString });
67 81
             table.put(data);
68 82
         }
69 83
 
@@ -72,7 +86,7 @@ public TabularData list() throws Exception {
72 86
         return table;
73 87
     }
74 88
 
75  
-    public int getStartLevel(long bundleId) throws Exception {
  89
+    public int getStartLevel(String bundleId) throws Exception {
76 90
         ServiceReference startLevelReference = bundleContext.getServiceReference(StartLevel.class.getName());
77 91
         if (startLevelReference == null) {
78 92
             throw new IllegalStateException("StartLevel service is not available");
@@ -81,12 +95,20 @@ public int getStartLevel(long bundleId) throws Exception {
81 95
         if (startLevel == null) {
82 96
             throw new IllegalStateException("StartLevel service is not available");
83 97
         }
84  
-        int bundleStartLevel = startLevel.getBundleStartLevel(bundleContext.getBundle(bundleId));
  98
+
  99
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  100
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  101
+
  102
+        if (bundles.size() != 1) {
  103
+            throw new IllegalArgumentException("Provided bundle Id doesn't return any bundle or more than one bundle selected");
  104
+        }
  105
+
  106
+        int bundleStartLevel = startLevel.getBundleStartLevel(bundles.get(0));
85 107
         bundleContext.ungetService(startLevelReference);
86 108
         return bundleStartLevel;
87 109
     }
88 110
 
89  
-    public void setStartLevel(long bundleId, int bundleStartLevel) throws Exception {
  111
+    public void setStartLevel(String bundleId, int bundleStartLevel) throws Exception {
90 112
         ServiceReference startLevelReference = bundleContext.getServiceReference(StartLevel.class.getName());
91 113
         if (startLevelReference == null) {
92 114
             throw new IllegalStateException("StartLevel service is not available");
@@ -95,7 +117,14 @@ public void setStartLevel(long bundleId, int bundleStartLevel) throws Exception
95 117
         if (startLevel == null) {
96 118
             throw new IllegalStateException("StartLevel service is not available");
97 119
         }
98  
-        startLevel.setBundleStartLevel(bundleContext.getBundle(bundleId), bundleStartLevel);
  120
+
  121
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  122
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  123
+
  124
+        for (Bundle bundle : bundles) {
  125
+            startLevel.setBundleStartLevel(bundle, bundleStartLevel);
  126
+        }
  127
+
99 128
         bundleContext.ungetService(startLevelReference);
100 129
     }
101 130
 
@@ -112,7 +141,7 @@ public void refresh() throws Exception {
112 141
         getBundleContext().ungetService(packageAdminReference);
113 142
     }
114 143
 
115  
-    public void refresh(long bundleId) throws Exception {
  144
+    public void refresh(String bundleId) throws Exception {
116 145
         ServiceReference packageAdminReference = getBundleContext().getServiceReference(PackageAdmin.class.getName());
117 146
         if (packageAdminReference == null) {
118 147
             throw new IllegalStateException("PackageAdmin service is not available");
@@ -121,21 +150,37 @@ public void refresh(long bundleId) throws Exception {
121 150
         if (packageAdmin == null) {
122 151
             throw new IllegalStateException("PackageAdmin service is not available");
123 152
         }
124  
-        packageAdmin.refreshPackages(new Bundle[]{ bundleContext.getBundle(bundleId) });
  153
+
  154
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  155
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  156
+
  157
+        Bundle[] bundlesArray = new Bundle[bundles.size()];
  158
+        packageAdmin.refreshPackages(bundles.toArray(bundlesArray));
  159
+
125 160
         getBundleContext().ungetService(packageAdminReference);
126 161
     }
127 162
 
128  
-    public void update(long bundleId) throws Exception {
  163
+    public void update(String bundleId) throws Exception {
129 164
         update(bundleId, null);
130 165
     }
131 166
 
132  
-    public void update(long bundleId, String location) throws Exception {
133  
-        if (location != null) {
134  
-            InputStream is = new URL(location).openStream();
135  
-            bundleContext.getBundle(bundleId).update(is);
136  
-        } else {
137  
-            bundleContext.getBundle(bundleId).update();
  167
+    public void update(String bundleId, String location) throws Exception {
  168
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  169
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  170
+
  171
+        if (location == null) {
  172
+            for (Bundle bundle : bundles) {
  173
+                bundle.update();
  174
+            }
  175
+            return;
  176
+        }
  177
+
  178
+        if (bundles.size() != 1) {
  179
+            throw new IllegalArgumentException("Provided bundle Id doesn't return any bundle or more than one bundle selected");
138 180
         }
  181
+
  182
+        InputStream is = new URL(location).openStream();
  183
+        bundles.get(0).update(is);
139 184
     }
140 185
 
141 186
     public void resolve() throws Exception {
@@ -151,7 +196,7 @@ public void resolve() throws Exception {
151 196
         getBundleContext().ungetService(packageAdminReference);
152 197
     }
153 198
 
154  
-    public void resolve(long bundleId) throws Exception {
  199
+    public void resolve(String bundleId) throws Exception {
155 200
         ServiceReference packageAdminReference = getBundleContext().getServiceReference(PackageAdmin.class.getName());
156 201
         if (packageAdminReference == null) {
157 202
             throw new IllegalStateException("PackageAdmin service is not available");
@@ -160,13 +205,24 @@ public void resolve(long bundleId) throws Exception {
160 205
         if (packageAdmin == null) {
161 206
             throw new IllegalStateException("PackageAdmin service is not available");
162 207
         }
163  
-        packageAdmin.resolveBundles(new Bundle[]{ bundleContext.getBundle(bundleId) });
  208
+
  209
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  210
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  211
+
  212
+        Bundle[] bundlesArray = new Bundle[bundles.size()];
  213
+        packageAdmin.resolveBundles(bundles.toArray(bundlesArray));
  214
+
164 215
         getBundleContext().ungetService(packageAdminReference);
165 216
     }
166 217
 
167  
-    public void restart(long bundleId) throws Exception {
168  
-        bundleContext.getBundle(bundleId).stop();
169  
-        bundleContext.getBundle(bundleId).start();
  218
+    public void restart(String bundleId) throws Exception {
  219
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  220
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  221
+
  222
+        for (Bundle bundle : bundles) {
  223
+            bundle.stop();
  224
+            bundle.start();
  225
+        };
170 226
     }
171 227
 
172 228
     public long install(String url) throws Exception {
@@ -181,16 +237,31 @@ public long install(String url, boolean start) throws Exception {
181 237
         return bundle.getBundleId();
182 238
     }
183 239
 
184  
-    public void start(long bundleId) throws Exception {
185  
-        bundleContext.getBundle(bundleId).start();
  240
+    public void start(String bundleId) throws Exception {
  241
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  242
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  243
+
  244
+        for (Bundle bundle : bundles) {
  245
+            bundle.start();
  246
+        }
186 247
     }
187 248
 
188  
-    public void stop(long bundleId) throws Exception {
189  
-        bundleContext.getBundle(bundleId).stop();
  249
+    public void stop(String bundleId) throws Exception {
  250
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  251
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  252
+
  253
+        for (Bundle bundle : bundles) {
  254
+            bundle.stop();
  255
+        }
190 256
     }
191 257
 
192  
-    public void uninstall(long bundleId) throws Exception {
193  
-        bundleContext.getBundle(bundleId).uninstall();
  258
+    public void uninstall(String bundleId) throws Exception {
  259
+        BundlesSelector selector = new BundlesSelector(bundleContext);
  260
+        List<Bundle> bundles = selector.selectBundles(bundleId);
  261
+
  262
+        for (Bundle bundle : bundles) {
  263
+            bundle.uninstall();
  264
+        }
194 265
     }
195 266
 
196 267
     public BundleContext getBundleContext() {
169  ...nt/mbeans/bundles/src/main/java/org/apache/karaf/management/mbeans/bundles/internal/BundlesSelector.java
... ...
@@ -0,0 +1,169 @@
  1
+/*
  2
+ * Licensed to the Apache Software Foundation (ASF) under one or more
  3
+ * contributor license agreements.  See the NOTICE file distributed with
  4
+ * this work for additional information regarding copyright ownership.
  5
+ * The ASF licenses this file to You under the Apache License, Version 2.0
  6
+ * (the "License"); you may not use this file except in compliance with
  7
+ * the License.  You may obtain a copy of the License at
  8
+ *
  9
+ *      http://www.apache.org/licenses/LICENSE-2.0
  10
+ *
  11
+ * Unless required by applicable law or agreed to in writing, software
  12
+ * distributed under the License is distributed on an "AS IS" BASIS,
  13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14
+ * See the License for the specific language governing permissions and
  15
+ * limitations under the License.
  16
+ */
  17
+package org.apache.karaf.management.mbeans.bundles.internal;
  18
+
  19
+import org.osgi.framework.Bundle;
  20
+import org.osgi.framework.BundleContext;
  21
+import org.osgi.framework.Constants;
  22
+
  23
+import java.util.ArrayList;
  24
+import java.util.List;
  25
+import java.util.regex.Matcher;
  26
+import java.util.regex.Pattern;
  27
+
  28
+/**
  29
+ * Bundles selector which is able to get a bundle by ID, ID range, name, and version.
  30
+ */
  31
+public class BundlesSelector {
  32
+
  33
+    private BundleContext bundleContext;
  34
+
  35
+    public BundlesSelector(BundleContext bundleContext) {
  36
+        this.bundleContext = bundleContext;
  37
+    }
  38
+
  39
+    /**
  40
+     * Select bundles with ID, ID range, name, and version.
  41
+     *
  42
+     * @param bundleId the bundles ID for selection.
  43
+     * @return the corresponding bundles found.
  44
+     * @throws Exception in case of selection
  45
+     */
  46
+    public List<Bundle> selectBundles(String bundleId) throws Exception {
  47
+        List<Bundle> bundles = new ArrayList<Bundle>();
  48
+        if (bundleId != null && bundleId.length() > 0) {
  49
+