harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r495839 [1/7] - in /harmony/enhanced/classlib/trunk/modules/lang-management: ./ META-INF/ make/ src/main/java/com/ src/main/java/com/ibm/ src/main/java/com/ibm/lang/ src/main/java/com/ibm/lang/management/ src/main/java/java/lang/management/...
Date Sat, 13 Jan 2007 05:08:52 GMT
Author: ndbeyer
Date: Fri Jan 12 21:08:48 2007
New Revision: 495839

URL: http://svn.apache.org/viewvc?view=rev&rev=495839
Log:
Initial merge of java.lang.management contribution from HARMONY-1407.

Added:
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.drl
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.ibm
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.drl
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.ibm
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.drl
    harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.ibm
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ManagementUtils.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/MemoryMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/MemoryManagerMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/MemoryNotificationThread.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/MemoryNotificationThreadShutdown.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/MemoryPoolMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/OpenTypeMappingIHandler.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/OperatingSystemMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/RuntimeMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ThreadMXBeanImpl.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/langmanagement/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/langmanagement/tests/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/langmanagement/tests/java/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/langmanagement/tests/java/lang/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/org/apache/harmony/langmanagement/tests/java/lang/management/
      - copied from r495823, harmony/enhanced/classlib/trunk/modules/lang-management/src/test/java/org/apache/harmony/langmanagement/tests/java/lang/management/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/ClassLoadingMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/CompilationMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/GarbageCollectorMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/LoggingMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/ManagementFactoryTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/ManagementPermissionTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/MemoryMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/MemoryManagerMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/MemoryPoolMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/MemoryUsageTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/OperatingSystemMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/RuntimeMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/lang/management/ThreadMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/util/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/util/logging/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/api/java/tests/java/util/logging/LoggingMXBeanTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/AttributeData.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/ClassLoadingMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/CompilationMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/DynamicMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/LoggingMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/MemoryMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/MemoryManagerImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/MemoryPoolMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/OperatingSystemMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/RuntimeMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/SimpleTestListener.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/ThreadInfoTest.java   (with props)
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/impl/java/com/ibm/lang/management/ThreadMXBeanImplTest.java   (with props)
Removed:
    harmony/enhanced/classlib/trunk/modules/lang-management/src/test/java/
Modified:
    harmony/enhanced/classlib/trunk/modules/lang-management/.classpath
    harmony/enhanced/classlib/trunk/modules/lang-management/META-INF/MANIFEST.MF
    harmony/enhanced/classlib/trunk/modules/lang-management/build.xml
    harmony/enhanced/classlib/trunk/modules/lang-management/make/hyproperties.xml
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/java/lang/management/ManagementFactory.java
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/java/lang/management/MemoryType.java
    harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/java/lang/management/ThreadInfo.java

Modified: harmony/enhanced/classlib/trunk/modules/lang-management/.classpath
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/.classpath?view=diff&rev=495839&r1=495838&r2=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/.classpath (original)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/.classpath Fri Jan 12 21:08:48 2007
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-    <classpathentry output="bin/main" kind="src" path="src/main/java"/>
-    <classpathentry output="bin/test" kind="src" path="src/test/java"/>
-    <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-    <classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
-    <classpathentry kind="output" path="bin"/>
+	<classpathentry kind="src" output="bin/main" path="src/main/java"/>
+	<classpathentry kind="src" output="bin/test/api" path="src/test/api/java"/>
+	<classpathentry kind="src" output="bin/test/impl" path="src/test/impl/java"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
+	<classpathentry kind="output" path="bin/main"/>
 </classpath>

Modified: harmony/enhanced/classlib/trunk/modules/lang-management/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/META-INF/MANIFEST.MF?view=diff&rev=495839&r1=495838&r2=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/META-INF/MANIFEST.MF Fri Jan 12 21:08:48 2007
@@ -16,6 +16,7 @@
  java.lang.reflect,
  java.security,
  java.util,
+ java.util.logging,
  javax.management,
  javax.management.modelmbean,
  javax.management.openmbean

Modified: harmony/enhanced/classlib/trunk/modules/lang-management/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/build.xml?view=diff&rev=495839&r1=495838&r2=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/build.xml Fri Jan 12 21:08:48 2007
@@ -30,13 +30,13 @@
         <or>
             <present targetdir="${hy.lang-management.src.main.java}" />
             <present targetdir="${hy.lang-management.src.main.java}">
-                <mapper type="regexp"
-                        from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
-                        to="\1.java"/>
+                <mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java" />
             </present>
         </or>
     </fileset>
 
+    <property name="exclude.file" location="./make/exclude.${hy.platform}.${hy.test.vm.name}" />
+
     <target name="build" depends="compile-java, build-jar" />
 
     <target name="test" depends="-test-module">
@@ -72,7 +72,7 @@
                destdir="${hy.build}"
                compiler="${hy.javac.compiler}"
                memoryMaximumSize="${hy.javac.maxmem}"
-               source="${hy.javac.source}" 
+               source="${hy.javac.source}"
                target="${hy.javac.target}"
                debug="${hy.javac.debug}">
 
@@ -91,33 +91,62 @@
              manifest="${hy.lang-management}/META-INF/MANIFEST.MF">
             <fileset refid="classes" />
             <manifest>
-                <attribute name="Implementation-Version" value="${svn.info}"/> 
+                <attribute name="Implementation-Version" value="${svn.info}" />
             </manifest>
-
-            <metainf refid="hy.required.metainf-files"/>
+            <metainf refid="hy.required.metainf-files" />
         </jar>
 
         <jar destfile="${hy.jdk}/jre/lib/boot/${hy.lang-management.packaging.jarname}-src.jar">
             <fileset dir="${hy.lang-management.src.main.java}" />
             <manifest>
-                <attribute name="Implementation-Version" value="${svn.info}"/> 
+                <attribute name="Implementation-Version" value="${svn.info}" />
             </manifest>
-
-            <metainf refid="hy.required.metainf-files"/>
+            <metainf refid="hy.required.metainf-files" />
         </jar>
     </target>
 
     <target name="compile-tests">
-        <echo message="Compiling LANG-MANAGEMENT tests" />
+        <antcall target="compile-tests-api" />
+        <antcall target="compile-tests-impl" />
+    </target>
+
+    <target name="compile-tests-api">
+        <echo message="Compiling LANG-MANAGEMENT API tests" />
+
+        <mkdir dir="${hy.lang-management.bin.test.api}" />
+
+        <javac srcdir="${hy.lang-management.src.test.api.java}"
+               destdir="${hy.lang-management.bin.test.api}"
+               sourcepath=""
+               compiler="${hy.javac.compiler}"
+               memoryMaximumSize="${hy.javac.maxmem}"
+               source="${hy.javac.source}"
+               target="${hy.javac.target}"
+               debug="${hy.javac.debug}">
+
+            <compilerarg line="${build.compilerarg}" />
 
-        <mkdir dir="${hy.lang-management.bin.test}" />
+            <bootclasspath>
+                <fileset dir="${hy.jdk}/jre/lib/boot">
+                    <include name="**/*.jar" />
+                </fileset>
+            </bootclasspath>
+            <classpath location="../../build/tests" />
+            <classpath location="${hy.hdk}/build/test/support.jar" />
+        </javac>
+    </target>
+
+    <target name="compile-tests-impl">
+        <echo message="Compiling LANG-MANAGEMENT Implementation tests" />
+
+        <mkdir dir="${hy.lang-management.bin.test.impl}" />
 
-        <javac srcdir="${hy.lang-management.src.test.java}"
-               destdir="${hy.lang-management.bin.test}"
+        <javac srcdir="${hy.lang-management.src.test.impl.java}"
+               destdir="${hy.lang-management.bin.test.impl}"
                sourcepath=""
                compiler="${hy.javac.compiler}"
                memoryMaximumSize="${hy.javac.maxmem}"
-               source="${hy.javac.source}" 
+               source="${hy.javac.source}"
                target="${hy.javac.target}"
                debug="${hy.javac.debug}">
 
@@ -134,7 +163,11 @@
     </target>
 
     <target name="run-tests">
+        <antcall target="run-tests-api" />
+        <antcall target="run-tests-impl" />
+    </target>
 
+    <target name="run-tests-api">
         <mkdir dir="${hy.tests.reports}" />
 
         <property name="test.jre.home" value="${hy.jdk}/jre" />
@@ -152,19 +185,56 @@
             <jvmarg line="${hy.test.vmargs}" />
 
             <classpath>
-                <pathelement path="${hy.lang-management.bin.test}"/>
+                <pathelement path="${hy.lang-management.bin.test.api}" />
             </classpath>
             <classpath location="${hy.hdk}/build/test/support.jar" />
 
             <formatter type="xml" />
 
-            <test name="${test.case}" todir="${hy.tests.reports}"
-                 if="test.case" />
+            <test name="${test.case}" todir="${hy.tests.reports}" if="test.case" />
+
+            <batchtest todir="${hy.tests.reports}" haltonfailure="no" unless="test.case">
+                <fileset dir="${hy.lang-management.src.test.api.java}" >
+                    <include name="**/*Test.java"/>
+                    <excludesfile name="${exclude.file}" />
+                </fileset>
+            </batchtest>
+        </junit>
+        <antcall target="touch-failures-file" />
+        <antcall target="touch-errors-file" />
+    </target>
+
+    <target name="run-tests-impl">
+        <mkdir dir="${hy.tests.reports}" />
+
+        <property name="test.jre.home" value="${hy.jdk}/jre" />
+
+        <junit fork="yes"
+               forkmode="${hy.test.forkmode}"
+               timeout="${hy.test.timeout}"
+               printsummary="withOutAndErr"
+               errorproperty="test.errors"
+               failureproperty="test.failures"
+               showoutput="on"
+               dir="${basedir}"
+               jvm="${test.jre.home}/bin/java">
+
+            <jvmarg line="${hy.test.vmargs}" />
+
+            <classpath>
+                <pathelement path="${hy.lang-management.bin.test.impl}" />
+            </classpath>
+            <classpath location="${hy.hdk}/build/test/support.jar" />
 
-            <batchtest todir="${hy.tests.reports}" haltonfailure="no"
-                unless="test.case">
+            <formatter type="xml" />
+
+            <test name="${test.case}" todir="${hy.tests.reports}" if="test.case" />
 
-                <fileset dir="${hy.lang-management.src.test.java}"/>
+            <batchtest todir="${hy.tests.reports}" haltonfailure="no" unless="test.case">
+                <fileset dir="${hy.lang-management.src.test.impl.java}">
+                    <include name="**/*Test.java" />
+                    <excludesfile name="${exclude.file}" />
+                </fileset>
             </batchtest>
         </junit>
         <antcall target="touch-failures-file" />
@@ -172,13 +242,11 @@
     </target>
 
     <target name="touch-failures-file" if="test.failures">
-        <echo file="${hy.tests.reports}/test.failures"
-            append="true">lang-management${line.separator}</echo>
+        <echo file="${hy.tests.reports}/test.failures" append="true">lang-management${line.separator}</echo>
     </target>
 
     <target name="touch-errors-file" if="test.errors">
-        <echo file="${hy.tests.reports}/test.errors"
-            append="true">lang-management${line.separator}</echo>
+        <echo file="${hy.tests.reports}/test.errors" append="true">lang-management${line.separator}</echo>
     </target>
 
 </project>

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.drl?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.drl (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.drl Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.ibm?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.ibm (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86.ibm Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.drl?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.drl (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.drl Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.ibm?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.ibm (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.linux.x86_64.ibm Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.drl?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.drl (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.drl Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.ibm?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.ibm (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86.ibm Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.drl
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.drl?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.drl (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.drl Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Added: harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.ibm
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.ibm?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.ibm (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/exclude.windows.x86_64.ibm Fri Jan 12 21:08:48 2007
@@ -0,0 +1,27 @@
+com/ibm/lang/management/ClassLoadingMXBeanImplTest.java
+com/ibm/lang/management/CompilationMXBeanImplTest.java
+com/ibm/lang/management/DynamicMXBeanImplTest.java
+com/ibm/lang/management/GarbageCollectorMXBeanImplTest.java
+com/ibm/lang/management/LoggingMXBeanImplTest.java
+com/ibm/lang/management/MemoryManagerImplTest.java
+com/ibm/lang/management/MemoryMXBeanImplTest.java
+com/ibm/lang/management/MemoryPoolMXBeanImplTest.java
+com/ibm/lang/management/MultiInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/RuntimeMXBeanImplTest.java
+com/ibm/lang/management/SingleInstanceDynamicMXBeanImplTest.java
+com/ibm/lang/management/ThreadInfoTest.java
+com/ibm/lang/management/ThreadMXBeanImplTest.java
+
+tests/java/lang/management/ClassLoadingMXBeanTest.java
+tests/java/lang/management/CompilationMXBeanTest.java
+tests/java/lang/management/GarbageCollectorMXBeanTest.java
+tests/java/lang/management/LoggingMXBeanTest.java
+tests/java/lang/management/ManagementFactoryTest.java
+tests/java/lang/management/MemoryManagerMXBeanTest.java
+tests/java/lang/management/MemoryMXBeanTest.java
+tests/java/lang/management/MemoryPoolMXBeanTest.java
+tests/java/lang/management/MemoryUsageTest.java
+tests/java/lang/management/RuntimeMXBeanTest.java
+tests/java/lang/management/ThreadMXBeanTest.java
+
+tests/java/util/logging/LoggingMXBeanTest.java
\ No newline at end of file

Modified: harmony/enhanced/classlib/trunk/modules/lang-management/make/hyproperties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/make/hyproperties.xml?view=diff&rev=495839&r1=495838&r2=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/make/hyproperties.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/make/hyproperties.xml Fri Jan 12 21:08:48 2007
@@ -24,13 +24,22 @@
             <resources location="src/main/resources" />
          </main>
          <test>
-            <java location="src/test/java" />
-            <resources location="src/test/resources" />
+	         <api>
+	            <java location="src/test/api/java" />
+	            <resources location="src/test/api/resources" />
+	         </api>
+	         <impl>
+	            <java location="src/test/impl/java" />
+	            <resources location="src/test/impl/resources" />
+	         </impl>
          </test>
       </src>
       <bin>
         <main location="bin/main" />
-        <test location="bin/test" />
+        <test>
+        	<api location="bin/api" />
+        	<impl location="bin/impl" />
+        </test>
       </bin>
       <packaging>
         <jarname>lang-management</jarname>

Added: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java Fri Jan 12 21:08:48 2007
@@ -0,0 +1,134 @@
+/* 
+ * 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.
+ */
+
+package com.ibm.lang.management;
+
+import java.lang.management.ClassLoadingMXBean;
+import java.lang.management.ManagementPermission;
+
+/**
+ * Runtime type for {@link ClassLoadingMXBean}.
+ * <p>
+ * There is only ever one instance of this class in a virtual machine.
+ * </p>
+ * 
+ * @since 1.5
+ */
+public final class ClassLoadingMXBeanImpl extends DynamicMXBeanImpl implements
+        ClassLoadingMXBean {
+
+    private static ClassLoadingMXBeanImpl instance = new ClassLoadingMXBeanImpl();
+
+    /**
+     * Constructor intentionally private to prevent instantiation by others.
+     * Sets the metadata for this bean.
+     */
+    private ClassLoadingMXBeanImpl() {
+        setMBeanInfo(ManagementUtils.getMBeanInfo(ClassLoadingMXBean.class
+                .getName()));
+    }
+
+    /**
+     * Singleton accessor method.
+     * 
+     * @return the <code>ClassLoadingMXBeanImpl</code> singleton.
+     */
+    static ClassLoadingMXBeanImpl getInstance() {
+        return instance;
+    }
+
+    /**
+     * @return the number of loaded classes
+     * @see #getLoadedClassCount()
+     */
+    private native int getLoadedClassCountImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.ClassLoadingMXBean#getLoadedClassCount()
+     */
+    public int getLoadedClassCount() {
+        return this.getLoadedClassCountImpl();
+    }
+
+    /**
+     * @return the total number of classes that have been loaded
+     * @see #getTotalLoadedClassCount()
+     */
+    private native long getTotalLoadedClassCountImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.ClassLoadingMXBean#getTotalLoadedClassCount()
+     */
+    public long getTotalLoadedClassCount() {
+        return this.getTotalLoadedClassCountImpl();
+    }
+
+    /**
+     * @return the total number of unloaded classes
+     * @see #getUnloadedClassCount()
+     */
+    private native long getUnloadedClassCountImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.ClassLoadingMXBean#getUnloadedClassCount()
+     */
+    public long getUnloadedClassCount() {
+        return this.getUnloadedClassCountImpl();
+    }
+
+    /**
+     * @return true if running in verbose mode
+     * @see #isVerbose()
+     */
+    private native boolean isVerboseImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.ClassLoadingMXBean#isVerbose()
+     */
+    public boolean isVerbose() {
+        return this.isVerboseImpl();
+    }
+
+    /**
+     * @param value
+     *            true to put the class loading system into verbose mode, false
+     *            to take the class loading system out of verbose mode.
+     * @see #setVerbose(boolean)
+     */
+    private native void setVerboseImpl(boolean value);
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.ClassLoadingMXBean#setVerbose(boolean)
+     */
+    public void setVerbose(boolean value) {
+        SecurityManager security = System.getSecurityManager();
+        if (security != null) {
+            security.checkPermission(new ManagementPermission("control"));
+        }
+        this.setVerboseImpl(value);
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/ClassLoadingMXBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java Fri Jan 12 21:08:48 2007
@@ -0,0 +1,122 @@
+/* 
+ * 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.
+ */
+
+package com.ibm.lang.management;
+
+import java.lang.management.CompilationMXBean;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * Runtime type for {@link CompilationMXBean}
+ * 
+ * @since 1.5
+ */
+public final class CompilationMXBeanImpl extends DynamicMXBeanImpl implements
+        CompilationMXBean {
+
+    private static CompilationMXBeanImpl instance = createInstance();
+
+    /**
+     * Conditionally returns the singleton instance of this type of MXBean.
+     * 
+     * @return if the virtual machine has a compilation system, returns a new
+     *         instance of <code>CompilationMXBean</code>, otherwise returns
+     *         <code>null</code>.
+     */
+    private static CompilationMXBeanImpl createInstance() {
+        CompilationMXBeanImpl result = null;
+
+        if (isJITEnabled()) {
+            result = new CompilationMXBeanImpl();
+        }
+        return result;
+    }
+
+	/**
+	 * Query whether the VM is running with a JIT compiler enabled.
+	 * 
+	 * @return true if a JIT is enabled, false otherwise
+	 */
+	private static native boolean isJITEnabled();
+	
+    /**
+     * Constructor intentionally private to prevent instantiation by others.
+     * Sets the metadata for this bean. 
+     */
+    private CompilationMXBeanImpl() {
+        setMBeanInfo(ManagementUtils.getMBeanInfo(CompilationMXBean.class
+                .getName()));
+    }
+
+    /**
+     * Singleton accessor method.
+     * 
+     * @return the <code>ClassLoadingMXBeanImpl</code> singleton.
+     */
+    static CompilationMXBeanImpl getInstance() {
+        return instance;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.CompilationMXBean#getName()
+     */
+    public String getName() {
+        return AccessController.doPrivileged(new PrivilegedAction<String>() {
+            public String run() {
+                return System.getProperty("java.compiler");
+            }// end method run
+        });
+    }
+
+    /**
+     * @return the compilation time in milliseconds
+     * @see #getTotalCompilationTime()
+     */
+    private native long getTotalCompilationTimeImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.CompilationMXBean#getTotalCompilationTime()
+     */
+    public long getTotalCompilationTime() {
+        if (!isCompilationTimeMonitoringSupported()) {
+            throw new UnsupportedOperationException(
+                    "VM does not support monitoring of compilation time.");
+        }
+        return this.getTotalCompilationTimeImpl();
+    }
+
+    /**
+     * @return <code>true</code> if compilation timing is supported, otherwise
+     *         <code>false</code>.
+     * @see #isCompilationTimeMonitoringSupported()
+     */
+    private native boolean isCompilationTimeMonitoringSupportedImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.CompilationMXBean#isCompilationTimeMonitoringSupported()
+     */
+    public boolean isCompilationTimeMonitoringSupported() {
+        return this.isCompilationTimeMonitoringSupportedImpl();
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/CompilationMXBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java Fri Jan 12 21:08:48 2007
@@ -0,0 +1,421 @@
+/* 
+ * 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.
+ */
+
+package com.ibm.lang.management;
+
+import java.lang.reflect.Method;
+
+import javax.management.Attribute;
+import javax.management.AttributeList;
+import javax.management.AttributeNotFoundException;
+import javax.management.DynamicMBean;
+import javax.management.InvalidAttributeValueException;
+import javax.management.MBeanAttributeInfo;
+import javax.management.MBeanException;
+import javax.management.MBeanInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
+import javax.management.ReflectionException;
+
+/**
+ * Abstract implementation of the {@link DynamicMBean} interface that provides
+ * behaviour required by a dynamic MBean. This class is subclassed by all of the
+ * concrete MXBean types in this package.
+ */
+public abstract class DynamicMXBeanImpl implements DynamicMBean {
+
+    protected MBeanInfo info;
+
+    /**
+     * @param info
+     */
+    protected void setMBeanInfo(MBeanInfo info) {
+        this.info = info;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#getAttributes(java.lang.String[])
+     */
+    public AttributeList getAttributes(String[] attributes) {
+        AttributeList result = new AttributeList();
+        for (int i = 0; i < attributes.length; i++) {
+            try {
+                Object value = getAttribute(attributes[i]);
+                result.add(new Attribute(attributes[i], value));
+            } catch (Exception e) {
+                // It is alright if the returned AttributeList is smaller in
+                // size than the length of the input array.
+                if (ManagementUtils.VERBOSE_MODE) {
+                    e.printStackTrace(System.err);
+                }// end if
+            }
+        }// end for
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#setAttributes(javax.management.AttributeList)
+     */
+    public AttributeList setAttributes(AttributeList attributes) {
+        AttributeList result = new AttributeList();
+
+        for (int i = 0; i < attributes.size(); i++) {
+            Attribute attrib = (Attribute) attributes.get(i);
+            String attribName = null;
+            Object attribVal = null;
+            try {
+                this.setAttribute(attrib);
+                attribName = attrib.getName();
+                // Note that the below getAttribute call will throw an
+                // AttributeNotFoundException if the named attribute is not
+                // readable for this bean. This is perfectly alright - the set
+                // has worked as requested - it just means that the caller
+                // does not get this information returned to them in the
+                // result AttributeList.
+                attribVal = getAttribute(attribName);
+                result.add(new Attribute(attribName, attribVal));
+            } catch (Exception e) {
+                if (ManagementUtils.VERBOSE_MODE) {
+                    e.printStackTrace(System.err);
+                }// end if
+            }
+        }// end for
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#getMBeanInfo()
+     */
+    public MBeanInfo getMBeanInfo() {
+        return info;
+    }
+
+    /**
+     * Simple enumeration of the different kinds of access that may be required
+     * of a dynamic MBean attribute.
+     */
+    enum AttributeAccessType {
+        READING, WRITING
+    };
+
+    /**
+     * Tests to see if this <code>DynamicMXBean</code> has an attribute with
+     * the name <code>attributeName</code>. If the test is passed, the
+     * {@link MBeanAttributeInfo}representing the attribute is returned.
+     * 
+     * @param attributeName
+     *            the name of the attribute being queried
+     * @param access
+     *            an {@link AttributeAccessType}indication of whether the
+     *            caller is looking for a readable or writable attribute.
+     * @return if the named attribute exists and is readable or writable
+     *         (depending on what was specified in <code>access</code>, an
+     *         instance of <code>MBeanAttributeInfo</code> that describes the
+     *         attribute, otherwise <code>null</code>.
+     */
+    protected MBeanAttributeInfo getPresentAttribute(String attributeName,
+            AttributeAccessType access) {
+        MBeanAttributeInfo[] attribs = info.getAttributes();
+        MBeanAttributeInfo result = null;
+
+        for (int i = 0; i < attribs.length; i++) {
+            MBeanAttributeInfo attribInfo = attribs[i];
+            if (attribInfo.getName().equals(attributeName)) {
+                if (access.equals(AttributeAccessType.READING)) {
+                    if (attribInfo.isReadable()) {
+                        result = attribInfo;
+                        break;
+                    }
+                } else {
+                    if (attribInfo.isWritable()) {
+                        result = attribInfo;
+                        break;
+                    }
+                }
+            }// end if
+        }// end for
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#getAttribute(java.lang.String)
+     */
+    public Object getAttribute(String attribute)
+            throws AttributeNotFoundException, MBeanException,
+            ReflectionException {
+        Object result = null;
+        Method getterMethod = null;
+        MBeanAttributeInfo attribInfo = getPresentAttribute(attribute,
+                AttributeAccessType.READING);
+        if (attribInfo == null) {
+            throw new AttributeNotFoundException("No such attribute : "
+                    + attribute);
+        }
+
+        try {
+            String getterPrefix = attribInfo.isIs() ? "is" : "get";
+            getterMethod = this.getClass().getMethod(getterPrefix + attribute,
+                    (Class[]) null);
+        } catch (Exception e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new ReflectionException(e);
+        }
+
+        String realReturnType = getterMethod.getReturnType().getName();
+        String openReturnType = attribInfo.getType();
+        result = invokeMethod(getterMethod, (Object[]) null);
+
+        try {
+            if (!realReturnType.equals(openReturnType)) {
+                result = ManagementUtils
+                        .convertToOpenType(result, Class
+                                .forName(openReturnType), Class
+                                .forName(realReturnType));
+            }// end if conversion necessary
+        } catch (ClassNotFoundException e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new MBeanException(e);
+        }
+
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#setAttribute(javax.management.Attribute)
+     */
+    public void setAttribute(Attribute attribute)
+            throws AttributeNotFoundException, InvalidAttributeValueException,
+            MBeanException, ReflectionException {
+
+        // In Java 5.0 platform MXBeans the following applies for all
+        // attribute setter methods :
+        // 1. no conversion to open MBean types necessary
+        // 2. all setter arguments are single value (i.e. not array or
+        // collection types).
+        // 3. all return null
+
+        Class argType = null;
+
+        // Validate the attribute
+        MBeanAttributeInfo attribInfo = getPresentAttribute(
+                attribute.getName(), AttributeAccessType.WRITING);
+        if (attribInfo == null) {
+            throw new AttributeNotFoundException("No such attribute : "
+                    + attribute);
+        }
+
+        try {
+            // Validate supplied parameter is of the expected type
+            argType = ManagementUtils.getClassMaybePrimitive(attribInfo
+                    .getType());
+        } catch (ClassNotFoundException e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new ReflectionException(e);
+        }
+
+        if (argType.isPrimitive()) {
+            if (!ManagementUtils.isWrapperClass(
+                    attribute.getValue().getClass(), argType)) {
+                throw new InvalidAttributeValueException(attribInfo.getName()
+                        + " is a " + attribInfo.getType() + " attribute");
+            }
+        } else if (!argType.equals(attribute.getValue().getClass())) {
+            throw new InvalidAttributeValueException(attribInfo.getName()
+                    + " is a " + attribInfo.getType() + " attribute");
+        }
+
+        Method setterMethod = null;
+        try {
+            setterMethod = this.getClass().getMethod(
+                    "set" + attribute.getName(), new Class[] { argType });
+        } catch (Exception e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new ReflectionException(e);
+        }
+
+        invokeMethod(setterMethod, attribute.getValue());
+        try {
+            setterMethod.invoke(this, attribute.getValue());
+        } catch (Exception e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            Throwable root = e.getCause();
+            if (root instanceof RuntimeException) {
+                throw (RuntimeException) root;
+            } else {
+                throw new MBeanException((Exception) root);
+            }// end else
+        }// end catch
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see javax.management.DynamicMBean#invoke(java.lang.String,
+     *      java.lang.Object[], java.lang.String[])
+     */
+    public Object invoke(String actionName, Object[] params, String[] signature)
+            throws MBeanException, ReflectionException {
+        Object result = null;
+
+        // If null is passed in for the signature argument (if invoking a
+        // method with no args for instance) then avoid any NPEs by working
+        // with a zero length String array instead.
+        String[] localSignature = signature;
+        if (localSignature == null) {
+            localSignature = new String[0];
+        }
+
+        // Validate that we have the named action
+        MBeanOperationInfo opInfo = getPresentOperation(actionName,
+                localSignature);
+        if (opInfo == null) {
+            throw new ReflectionException(
+                    new NoSuchMethodException(actionName),
+                    "No such operation : " + actionName);
+        }
+
+        // For Java 5.0 platform MXBeans, no conversion
+        // to open MBean types is necessary for any of the arguments.
+        // i.e. they are all simple types.
+        Method operationMethod = null;
+        try {
+            Class[] argTypes = new Class[localSignature.length];
+            for (int i = 0; i < localSignature.length; i++) {
+                argTypes[i] = ManagementUtils
+                        .getClassMaybePrimitive(localSignature[i]);
+            }// end for
+            operationMethod = this.getClass().getMethod(actionName, argTypes);
+        } catch (Exception e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new ReflectionException(e);
+        }
+
+        String realReturnType = operationMethod.getReturnType().getName();
+        String openReturnType = opInfo.getReturnType();
+        result = invokeMethod(operationMethod, params);
+
+        try {
+            if (!realReturnType.equals(openReturnType)) {
+                result = ManagementUtils
+                        .convertToOpenType(result, Class
+                                .forName(openReturnType), Class
+                                .forName(realReturnType));
+            }
+        } catch (ClassNotFoundException e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            throw new MBeanException(e);
+        }// end catch
+
+        return result;
+    }
+
+    /**
+     * Tests to see if this <code>DynamicMXBean</code> has an operation with
+     * the name <code>actionName</code>. If the test is passed, the
+     * {@link MBeanOperationInfo}representing the operation is returned to the
+     * caller.
+     * 
+     * @param actionName
+     *            the name of a possible method on this
+     *            <code>DynamicMXBean</code>
+     * @param signature
+     *            the list of parameter types for the named operation in the
+     *            correct order
+     * @return if the named operation exists, an instance of
+     *         <code>MBeanOperationInfo</code> that describes the operation,
+     *         otherwise <code>null</code>.
+     */
+    protected MBeanOperationInfo getPresentOperation(String actionName,
+            String[] signature) {
+        MBeanOperationInfo[] operations = info.getOperations();
+        MBeanOperationInfo result = null;
+
+        for (int i = 0; i < operations.length; i++) {
+            MBeanOperationInfo opInfo = operations[i];
+            if (opInfo.getName().equals(actionName)) {
+                // Do parameter numbers match ?
+                if (signature.length == opInfo.getSignature().length) {
+                    // Do parameter types match ?
+                    boolean match = true;
+                    MBeanParameterInfo[] parameters = opInfo.getSignature();
+                    for (int j = 0; j < parameters.length; j++) {
+                        MBeanParameterInfo paramInfo = parameters[j];
+                        if (!paramInfo.getType().equals(signature[j])) {
+                            match = false;
+                            break;
+                        }
+                    }// end for all parameters
+                    if (match) {
+                        result = opInfo;
+                        break;
+                    }
+                }// end if parameter counts match
+            }// end if operation names match
+        }// end for all operations
+
+        return result;
+    }
+
+    /**
+     * @param params
+     * @param operationMethod
+     * @return the result of the reflective method invocation
+     * @throws MBeanException
+     */
+    private Object invokeMethod(Method operationMethod, Object... params)
+            throws MBeanException {
+        Object result = null;
+        try {
+            result = operationMethod.invoke(this, params);
+        } catch (Exception e) {
+            if (ManagementUtils.VERBOSE_MODE) {
+                e.printStackTrace(System.err);
+            }// end if
+            Throwable root = e.getCause();
+            if (root instanceof RuntimeException) {
+                throw (RuntimeException) root;
+            } else {
+                throw new MBeanException((Exception) root);
+            }// end else
+        }// end catch
+        return result;
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/DynamicMXBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java Fri Jan 12 21:08:48 2007
@@ -0,0 +1,80 @@
+/* 
+ * 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.
+ */
+
+package com.ibm.lang.management;
+
+import java.lang.management.GarbageCollectorMXBean;
+
+
+/**
+ * Runtime type for {@link java.lang.management.GarbageCollectorMXBean}.
+ * 
+ * @since 1.5
+ */
+public final class GarbageCollectorMXBeanImpl extends MemoryManagerMXBeanImpl
+        implements GarbageCollectorMXBean {
+
+    /**
+     * @param name The name of this collector
+     * @param id An internal id number representing this collector
+     * @param memBean The memory bean that receives notification events from pools managed by this collector
+     */
+    GarbageCollectorMXBeanImpl(String name, int id, MemoryMXBeanImpl memBean ) {
+        super(name, id, memBean);
+    }
+
+    /**
+     * Sets the metadata for this bean.
+     */
+    protected void initializeInfo() {
+        setMBeanInfo(ManagementUtils
+                .getMBeanInfo(java.lang.management.GarbageCollectorMXBean.class
+                        .getName()));
+    }
+
+    /**
+     * @return the total number of garbage collections that have been carried
+     *         out by the associated garbage collector.
+     * @see #getCollectionCount()
+     */
+    private native long getCollectionCountImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.GarbageCollectorMXBean#getCollectionCount()
+     */
+    public long getCollectionCount() {
+        return this.getCollectionCountImpl();
+    }
+
+    /**
+     * @return the number of milliseconds that have been spent in performing
+     *         garbage collection. This is a cumulative figure.
+     * @see #getCollectionTime()
+     */
+    private native long getCollectionTimeImpl();
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.management.GarbageCollectorMXBean#getCollectionTime()
+     */
+    public long getCollectionTime() {
+        return this.getCollectionTimeImpl();
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/GarbageCollectorMXBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java?view=auto&rev=495839
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java Fri Jan 12 21:08:48 2007
@@ -0,0 +1,147 @@
+/* 
+ * 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.
+ */
+
+package com.ibm.lang.management;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+import java.util.logging.LoggingMXBean;
+
+/**
+ * Runtime type for {@link java.util.logging.LoggingMXBean}.
+ * 
+ * @since 1.5
+ */
+public class LoggingMXBeanImpl extends DynamicMXBeanImpl implements
+        LoggingMXBean {
+
+    private static LoggingMXBeanImpl instance = new LoggingMXBeanImpl();
+
+    /**
+     * Constructor intentionally private to prevent instantiation by others.
+     * Sets the metadata for this bean.
+     */
+    private LoggingMXBeanImpl() {
+        setMBeanInfo(ManagementUtils
+                .getMBeanInfo(LoggingMXBean.class.getName()));
+    }
+
+    /**
+     * Singleton accessor method.
+     * 
+     * @return the <code>LoggingMXBeanImpl</code> singleton.
+     */
+    static LoggingMXBeanImpl getInstance() {
+        return instance;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.util.logging.LoggingMXBean#getLoggerLevel(java.lang.String)
+     */
+    public String getLoggerLevel(String loggerName) {
+        String result = null;
+
+        Logger logger = LogManager.getLogManager().getLogger(loggerName);
+        if (logger != null) {
+            // The named Logger exists. Now attempt to obtain its log level.
+            Level level = logger.getLevel();
+            if (level != null) {
+                result = level.getName();
+            } else {
+                // A null return from getLevel() means that the Logger
+                // is inheriting its log level from an ancestor. Return an
+                // empty string to the caller.
+                result = "";
+            }
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.util.logging.LoggingMXBean#getLoggerNames()
+     */
+    public List<String> getLoggerNames() {
+        // By default, return an empty list to caller
+        List<String> result = new ArrayList<String>();
+
+        Enumeration<String> enumeration = LogManager.getLogManager()
+                .getLoggerNames();
+        if (enumeration != null) {
+            while (enumeration.hasMoreElements()) {
+                result.add(enumeration.nextElement());
+            }
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.util.logging.LoggingMXBean#getParentLoggerName(java.lang.String)
+     */
+    public String getParentLoggerName(String loggerName) {
+        String result = null;
+
+        Logger logger = LogManager.getLogManager().getLogger(loggerName);
+        if (logger != null) {
+            // The named Logger exists. Now attempt to obtain its parent.
+            Logger parent = logger.getParent();
+            if (parent != null) {
+                // There is a parent
+                result = parent.getName();
+            } else {
+                // logger must be the root Logger
+                result = "";
+            }
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.util.logging.LoggingMXBean#setLoggerLevel(java.lang.String,
+     *      java.lang.String)
+     */
+    public void setLoggerLevel(String loggerName, String levelName) {
+        final Logger logger = LogManager.getLogManager().getLogger(loggerName);
+        if (logger != null) {
+            // The named Logger exists. Now attempt to set its level. The
+            // below attempt to parse a Level from the supplied levelName
+            // will throw an IllegalArgumentException if levelName is not
+            // a valid level name.
+            if (levelName != null) {
+                Level newLevel = Level.parse(levelName);
+                logger.setLevel(newLevel);
+            } else {
+                logger.setLevel(null);
+            }
+        } else {
+            // Named Logger does not exist.
+            throw new IllegalArgumentException(
+                    "Unable to find Logger with name " + loggerName);
+        }
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/lang-management/src/main/java/com/ibm/lang/management/LoggingMXBeanImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message