FELIX-1149: Describe ConfigAdmin configurations using metatype

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@773973 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/gshell/gshell-log/src/main/resources/META-INF/spring/gshell-log.xml b/karaf/gshell/gshell-log/src/main/resources/META-INF/spring/gshell-log.xml
index 3e8c463..f425142 100644
--- a/karaf/gshell/gshell-log/src/main/resources/META-INF/spring/gshell-log.xml
+++ b/karaf/gshell/gshell-log/src/main/resources/META-INF/spring/gshell-log.xml
@@ -86,7 +86,7 @@
         </osgi:service-properties>
     </osgi:service>
 
-    <osgix:cm-properties id="cmProps" persistent-id="org.apache.servicemix.log">
+    <osgix:cm-properties id="cmProps" persistent-id="org.apache.felix.karaf.log">
         <prop key="size">500</prop>
         <prop key="pattern">%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n</prop>
     </osgix:cm-properties>
diff --git a/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.properties b/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..96bb60b
--- /dev/null
+++ b/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor
+
+log.name = Apache Felix Karaf Log
+log.description = Configuration of Apache Felix Karaf Log
+
+size.name = Size
+size.description = size of the log to keep in memory
+
+pattern.name = Pattern
+pattern.description = Pattern used to display log entries
diff --git a/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.xml b/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.xml
new file mode 100644
index 0000000..c41898a
--- /dev/null
+++ b/karaf/gshell/gshell-log/src/main/resources/OSGI-INF/metatype/metatype.xml
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0" localization="OSGI-INF/metatype/metatype">
+    <OCD id="org.apache.felix.karaf.log" name="%log.name" description="%log.description">
+        <AD id="size" type="Integer" default="500" name="%size.name"
+            description="%size.description"/>
+        <AD id="pattern" type="String" default="%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %-32.32C %4L | %m%n" name="%pattern.name"
+            description="%pattern.description"/>
+    </OCD>
+    <Designate pid="org.apache.felix.karaf.log">
+        <Object ocdref="org.apache.felix.karaf.log"/>
+    </Designate>
+</metatype:MetaData>
diff --git a/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.properties b/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..880f228
--- /dev/null
+++ b/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,34 @@
+#
+#  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.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor
+
+shell.name = Apache Felix Karaf Shell
+shell.description = Configuration of Apache Felix Karaf Shell
+
+sshPort.name = SSH Port
+sshPort.description = port of the SSH server
+
+sshRealm.name = SSH Realm
+sshRealm.description = name of the JAAS realm used for authentication
+
+hostKey.name = Host keys
+hostKey.description = Path to the host key file
diff --git a/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.xml b/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.xml
new file mode 100644
index 0000000..5c851f9
--- /dev/null
+++ b/karaf/gshell/gshell-run/src/main/resources/OSGI-INF/metatype/metatype.xml
@@ -0,0 +1,32 @@
+<?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.
+
+-->
+<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0" localization="OSGI-INF/metatype/metatype">
+    <OCD id="org.apache.felix.karaf.shell" name="%shell.name" description="%shell.description">
+        <AD id="sshPort" type="Integer" default="8101" name="%sshPort.name"
+            description="%sshPort.description"/>
+        <AD id="sshRealm" type="String" default="karaf" name="%sshRealm.name"
+            description="%sshRealm.description"/>
+        <AD id="hostKey" type="String" default="${karaf.base}/etc/host.key" name="%hostKey.name"
+            description="%hostKey.description"/>
+    </OCD>
+    <Designate pid="org.apache.felix.karaf.shell">
+        <Object ocdref="org.apache.felix.karaf.shell"/>
+    </Designate>
+</metatype:MetaData>
diff --git a/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.properties b/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.properties
new file mode 100644
index 0000000..2869f52
--- /dev/null
+++ b/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -0,0 +1,44 @@
+#
+#  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.
+#
+
+#
+# This file contains localization strings for configuration labels and
+# descriptions as used in the metatype.xml descriptor
+
+management.name = Apache Felix Karaf JMX Management
+management.description = Configuration of Apache Felix Karaf JMX Management
+
+rmiRegistryPort.name = RMI Port
+rmiRegistryPort.description = port of the registry for the exported RMI service
+
+jmxRealm.name = Realm
+jmxRealm.description = name of the JAAS realm used for authentication
+
+serviceUrl.name = Service Url
+serviceUrl.description = the service URL for the JMXConnectorServer
+
+daemon.name = Daemon
+daemon.description = whether any threads started for the JMXConnectorServer should be started as daemon threads
+
+threaded.name = Threaded
+threaded.description = whether the JMXConnectorServer should be started in a separate thread
+
+objectName.name = ObjectName
+objectName.description = the ObjectName used to register the JMXConnectorServer
+
diff --git a/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.xml b/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.xml
new file mode 100644
index 0000000..e8d4bbd
--- /dev/null
+++ b/karaf/management/src/main/resources/OSGI-INF/metatype/metatype.xml
@@ -0,0 +1,35 @@
+<?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.
+
+-->
+<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0" localization="OSGI-INF/metatype/metatype">
+    <OCD id="org.apache.felix.karaf.management" name="%management.name" description="%management.description">
+        <AD id="rmiRegistryPort" type="Integer" default="1099" name="%rmiRegistryPort.name"
+            description="%rmiRegistryPort.description"/>
+        <AD id="jmxRealm" type="String" default="karaf" name="%jmxRealm.name"
+            description="%jmxRealm.description"/>
+        <AD id="serviceUrl" type="String" default="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi" name="%serviceUrl.name"
+            description="%serviceUrl.description"/>
+        <AD id="daemon" type="Boolean" default="true" name="%daemon.name" description="%daemon.description"/>
+        <AD id="threaded" type="Boolean" default="true" name="%threaded.name" description="%threaded.description"/>
+        <AD id="objectName" type="String" default="connector:name=rmi" name="%objectName.name" description="%objectName.description"/>
+    </OCD>
+    <Designate pid="org.apache.felix.karaf.management">
+        <Object ocdref="org.apache.felix.karaf.management"/>
+    </Designate>
+</metatype:MetaData>