FELIX-1766: Refactor and enable AdminServiceMBean

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@828802 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/assembly/src/main/descriptors/unix-bin.xml b/karaf/assembly/src/main/descriptors/unix-bin.xml
index ab92574..a0289cf 100644
--- a/karaf/assembly/src/main/descriptors/unix-bin.xml
+++ b/karaf/assembly/src/main/descriptors/unix-bin.xml
@@ -189,6 +189,17 @@
             <outputDirectory>/system</outputDirectory>
             <unpack>false</unpack>
             <useProjectArtifact>false</useProjectArtifact>
+            <outputFileNameMapping>org/apache/felix/karaf/admin/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+            <includes>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.core</include>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.command</include>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.management</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>/system</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
             <outputFileNameMapping>org/apache/felix/karaf/deployer/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.deployer:org.apache.felix.karaf.deployer.spring</include>
@@ -203,7 +214,6 @@
             <outputFileNameMapping>org/apache/felix/karaf/shell/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.console</include>
-                <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.admin</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.osgi</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.log</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.config</include>
diff --git a/karaf/assembly/src/main/descriptors/windows-bin.xml b/karaf/assembly/src/main/descriptors/windows-bin.xml
index 232cc76..7adbe14 100644
--- a/karaf/assembly/src/main/descriptors/windows-bin.xml
+++ b/karaf/assembly/src/main/descriptors/windows-bin.xml
@@ -180,6 +180,17 @@
             <outputDirectory>/system</outputDirectory>
             <unpack>false</unpack>
             <useProjectArtifact>false</useProjectArtifact>
+            <outputFileNameMapping>org/apache/felix/karaf/admin/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
+            <includes>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.core</include>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.command</include>
+                <include>org.apache.felix.karaf.admin:org.apache.felix.karaf.admin.management</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
+            <outputDirectory>/system</outputDirectory>
+            <unpack>false</unpack>
+            <useProjectArtifact>false</useProjectArtifact>
             <outputFileNameMapping>org/apache/felix/karaf/deployer/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.deployer:org.apache.felix.karaf.deployer.spring</include>
@@ -194,7 +205,6 @@
             <outputFileNameMapping>org/apache/felix/karaf/shell/${artifact.artifactId}/${artifact.baseVersion}/${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
             <includes>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.console</include>
-                <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.admin</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.osgi</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.log</include>
                 <include>org.apache.felix.karaf.shell:org.apache.felix.karaf.shell.config</include>
diff --git a/karaf/assembly/src/main/filtered-resources/bin/admin b/karaf/assembly/src/main/filtered-resources/bin/admin
index 226f7c1..bd468f5 100644
--- a/karaf/assembly/src/main/filtered-resources/bin/admin
+++ b/karaf/assembly/src/main/filtered-resources/bin/admin
@@ -273,7 +273,7 @@
 
     CLASSPATH=${KARAF_HOME}/system/org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.admin/${project.version}/org.apache.felix.karaf.shell.admin-${project.version}.jar:${KARAF_HOME}/system/org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.console/${project.version}/org.apache.felix.karaf.shell.console-${project.version}.jar:${KARAF_HOME}/system/org/apache/felix/gogo/org.apache.felix.gogo.runtime/${felix.gogo.version}/org.apache.felix.gogo.runtime-${felix.gogo.version}.jar:${KARAF_HOME}/system/org/apache/geronimo/blueprint/geronimo-blueprint/${geronimo.blueprint.version}/geronimo-blueprint-${geronimo.blueprint.version}.jar:${KARAF_HOME}/system/org/ops4j/pax/logging/pax-logging-api/${pax.logging.version}/pax-logging-api-${pax.logging.version}.jar:${KARAF_HOME}/system/org/apache/felix/org.apache.felix.framework/${felix.framework.version}/org.apache.felix.framework-${felix.framework.version}.jar
 
-    exec $JAVA $JAVA_OPTS -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.felix.karaf.shell.admin.main.Execute "$@"
+    exec $JAVA $JAVA_OPTS -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" org.apache.felix.karaf.admin.main.Execute "$@"
 }
 
 main() {
diff --git a/karaf/assembly/src/main/filtered-resources/bin/admin.bat b/karaf/assembly/src/main/filtered-resources/bin/admin.bat
index 3dfcf30..b16f9f6 100644
--- a/karaf/assembly/src/main/filtered-resources/bin/admin.bat
+++ b/karaf/assembly/src/main/filtered-resources/bin/admin.bat
@@ -87,7 +87,7 @@
     if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8
     if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8    
     rem Execute the Java Virtual Machine
-    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.felix.karaf.shell.admin.main.Execute %ARGS%
+    "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" org.apache.felix.karaf.admin.main.Execute %ARGS%
 
 rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
 
diff --git a/karaf/assembly/src/main/filtered-resources/etc/startup.properties b/karaf/assembly/src/main/filtered-resources/etc/startup.properties
index b1b679b..1a79a4d 100644
--- a/karaf/assembly/src/main/filtered-resources/etc/startup.properties
+++ b/karaf/assembly/src/main/filtered-resources/etc/startup.properties
@@ -41,7 +41,6 @@
 org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.spring/${pom.version}/org.apache.felix.karaf.deployer.spring-${pom.version}.jar=30
 org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.blueprint/${pom.version}/org.apache.felix.karaf.deployer.blueprint-${pom.version}.jar=30
 org/apache/felix/karaf/deployer/org.apache.felix.karaf.deployer.features/${pom.version}/org.apache.felix.karaf.deployer.features-${pom.version}.jar=30
-org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.admin/${pom.version}/org.apache.felix.karaf.shell.admin-${pom.version}.jar=30
 org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.osgi/${pom.version}/org.apache.felix.karaf.shell.osgi-${pom.version}.jar=30
 org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.log/${pom.version}/org.apache.felix.karaf.shell.log-${pom.version}.jar=30
 org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.config/${pom.version}/org.apache.felix.karaf.shell.config-${pom.version}.jar=30
@@ -49,7 +48,9 @@
 org/apache/felix/karaf/shell/org.apache.felix.karaf.shell.commands/${pom.version}/org.apache.felix.karaf.shell.commands-${pom.version}.jar=30
 org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.config/${pom.version}/org.apache.felix.karaf.jaas.config-${pom.version}.jar=30
 org/apache/felix/karaf/jaas/org.apache.felix.karaf.jaas.modules/${pom.version}/org.apache.felix.karaf.jaas.modules-${pom.version}.jar=30
-
+org/apache/felix/karaf/admin/org.apache.felix.karaf.admin.core/${pom.version}/org.apache.felix.karaf.admin.core-${pom.version}.jar=30
+org/apache/felix/karaf/admin/org.apache.felix.karaf.admin.command/${pom.version}/org.apache.felix.karaf.admin.command-${pom.version}.jar=30
+org/apache/felix/karaf/admin/org.apache.felix.karaf.admin.management/${pom.version}/org.apache.felix.karaf.admin.management-${pom.version}.jar=30
 org/apache/felix/karaf/features/org.apache.felix.karaf.features.core/${pom.version}/org.apache.felix.karaf.features.core-${pom.version}.jar=30
 org/apache/felix/karaf/features/org.apache.felix.karaf.features.command/${pom.version}/org.apache.felix.karaf.features.command-${pom.version}.jar=30
 org/apache/felix/karaf/features/org.apache.felix.karaf.features.management/${pom.version}/org.apache.felix.karaf.features.management-${pom.version}.jar=30