summaryrefslogtreecommitdiff
path: root/gnu/java/lang
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/java/lang')
-rw-r--r--gnu/java/lang/management/BeanImpl.java19
-rw-r--r--gnu/java/lang/management/ClassLoadingMXBeanImpl.java16
-rw-r--r--gnu/java/lang/management/CompilationMXBeanImpl.java16
-rw-r--r--gnu/java/lang/management/GarbageCollectorMXBeanImpl.java9
-rw-r--r--gnu/java/lang/management/MemoryMXBeanImpl.java12
-rw-r--r--gnu/java/lang/management/MemoryManagerMXBeanImpl.java25
-rw-r--r--gnu/java/lang/management/MemoryPoolMXBeanImpl.java8
-rw-r--r--gnu/java/lang/management/OperatingSystemMXBeanImpl.java18
-rw-r--r--gnu/java/lang/management/RuntimeMXBeanImpl.java16
-rw-r--r--gnu/java/lang/management/ThreadMXBeanImpl.java9
10 files changed, 145 insertions, 3 deletions
diff --git a/gnu/java/lang/management/BeanImpl.java b/gnu/java/lang/management/BeanImpl.java
index 1845d7abc..24572a25d 100644
--- a/gnu/java/lang/management/BeanImpl.java
+++ b/gnu/java/lang/management/BeanImpl.java
@@ -39,6 +39,9 @@ package gnu.java.lang.management;
import java.lang.management.ManagementPermission;
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardMBean;
+
/**
* A common superclass for bean implementations.
*
@@ -46,7 +49,23 @@ import java.lang.management.ManagementPermission;
* @since 1.5
*/
public class BeanImpl
+ extends StandardMBean
{
+
+ /**
+ * Constructs a new <code>BeanImpl</code>.
+ *
+ * @param iface the bean interface being implemented.
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ protected BeanImpl(Class iface)
+ throws NotCompliantMBeanException
+ {
+ super(iface);
+ }
protected void checkMonitorPermissions()
{
diff --git a/gnu/java/lang/management/ClassLoadingMXBeanImpl.java b/gnu/java/lang/management/ClassLoadingMXBeanImpl.java
index d93ccf2c3..92e68ae76 100644
--- a/gnu/java/lang/management/ClassLoadingMXBeanImpl.java
+++ b/gnu/java/lang/management/ClassLoadingMXBeanImpl.java
@@ -39,6 +39,8 @@ package gnu.java.lang.management;
import java.lang.management.ClassLoadingMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about the class loading
* behaviour of the current invocation of the virtual
@@ -53,6 +55,20 @@ public final class ClassLoadingMXBeanImpl
implements ClassLoadingMXBean
{
+ /**
+ * Constructs a new <code>ClassLoadingMXBeanImpl</code>.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ public ClassLoadingMXBeanImpl()
+ throws NotCompliantMBeanException
+ {
+ super(ClassLoadingMXBean.class);
+ }
+
public int getLoadedClassCount()
{
return VMClassLoadingMXBeanImpl.getLoadedClassCount();
diff --git a/gnu/java/lang/management/CompilationMXBeanImpl.java b/gnu/java/lang/management/CompilationMXBeanImpl.java
index 044150fae..b3ad898b5 100644
--- a/gnu/java/lang/management/CompilationMXBeanImpl.java
+++ b/gnu/java/lang/management/CompilationMXBeanImpl.java
@@ -41,6 +41,8 @@ import gnu.classpath.SystemProperties;
import java.lang.management.CompilationMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about the JIT
* compiler of the virtual machine, if one exists.
@@ -67,6 +69,20 @@ public final class CompilationMXBeanImpl
private static final String COMPILATION_TIME_SUPPORT =
"gnu.java.lang.management.CompilationTimeSupport";
+ /**
+ * Constructs a new <code>CompilationMXBeanImpl</code>.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ public CompilationMXBeanImpl()
+ throws NotCompliantMBeanException
+ {
+ super(CompilationMXBean.class);
+ }
+
public String getName()
{
return SystemProperties.getProperty(COMPILER_NAME);
diff --git a/gnu/java/lang/management/GarbageCollectorMXBeanImpl.java b/gnu/java/lang/management/GarbageCollectorMXBeanImpl.java
index 19db8df1b..b752e6b86 100644
--- a/gnu/java/lang/management/GarbageCollectorMXBeanImpl.java
+++ b/gnu/java/lang/management/GarbageCollectorMXBeanImpl.java
@@ -39,6 +39,8 @@ package gnu.java.lang.management;
import java.lang.management.GarbageCollectorMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about one of the garbage
* collectors used by the current invocation of the
@@ -58,10 +60,15 @@ public final class GarbageCollectorMXBeanImpl
* Constructs a new <code>GarbageCollectorMXBeanImpl</code>.
*
* @param name the name of the garbage collector this bean represents.
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
*/
public GarbageCollectorMXBeanImpl(String name)
+ throws NotCompliantMBeanException
{
- super(name);
+ super(name, GarbageCollectorMXBean.class);
}
public long getCollectionCount()
diff --git a/gnu/java/lang/management/MemoryMXBeanImpl.java b/gnu/java/lang/management/MemoryMXBeanImpl.java
index 6890130d4..064e19a19 100644
--- a/gnu/java/lang/management/MemoryMXBeanImpl.java
+++ b/gnu/java/lang/management/MemoryMXBeanImpl.java
@@ -47,6 +47,7 @@ import java.util.List;
import javax.management.ListenerNotFoundException;
import javax.management.MBeanNotificationInfo;
+import javax.management.NotCompliantMBeanException;
import javax.management.Notification;
import javax.management.NotificationEmitter;
import javax.management.NotificationFilter;
@@ -120,9 +121,18 @@ public final class MemoryMXBeanImpl
}
}
-
+ /**
+ * Constructs a new <code>MemoryMXBeanImpl</code>.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
public MemoryMXBeanImpl()
+ throws NotCompliantMBeanException
{
+ super(MemoryMXBean.class);
listeners = new ArrayList();
notificationCount = 0;
}
diff --git a/gnu/java/lang/management/MemoryManagerMXBeanImpl.java b/gnu/java/lang/management/MemoryManagerMXBeanImpl.java
index 2c6d4472a..5766af9cc 100644
--- a/gnu/java/lang/management/MemoryManagerMXBeanImpl.java
+++ b/gnu/java/lang/management/MemoryManagerMXBeanImpl.java
@@ -39,6 +39,8 @@ package gnu.java.lang.management;
import java.lang.management.MemoryManagerMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about one of the memory
* managers used by the current invocation of the
@@ -63,9 +65,32 @@ public class MemoryManagerMXBeanImpl
* Constructs a new <code>MemoryManagerMXBeanImpl</code>.
*
* @param name the name of the manager this bean represents.
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
*/
public MemoryManagerMXBeanImpl(String name)
+ throws NotCompliantMBeanException
+ {
+ this(name, MemoryManagerMXBean.class);
+ }
+
+ /**
+ * Constructs a new <code>MemoryManagerMXBeanImpl</code>
+ * implementing the specified bean interface.
+ *
+ * @param name the name of the manager this bean represents.
+ * @param iface the bean interface being implemented.
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ protected MemoryManagerMXBeanImpl(String name, Class iface)
+ throws NotCompliantMBeanException
{
+ super(iface);
this.name = name;
}
diff --git a/gnu/java/lang/management/MemoryPoolMXBeanImpl.java b/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
index 9554aae00..ed4dccd76 100644
--- a/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
+++ b/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
@@ -42,6 +42,8 @@ import gnu.classpath.SystemProperties;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.MemoryUsage;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about one of the memory
* resources or pools used by the current invocation of the
@@ -78,9 +80,15 @@ public final class MemoryPoolMXBeanImpl
* Constructs a new <code>MemoryPoolMXBeanImpl</code>.
*
* @param name the name of the pool this bean represents.
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
*/
public MemoryPoolMXBeanImpl(String name)
+ throws NotCompliantMBeanException
{
+ super(MemoryPoolMXBean.class);
this.name = name;
}
diff --git a/gnu/java/lang/management/OperatingSystemMXBeanImpl.java b/gnu/java/lang/management/OperatingSystemMXBeanImpl.java
index 7e76c8cd1..9eefc0d9d 100644
--- a/gnu/java/lang/management/OperatingSystemMXBeanImpl.java
+++ b/gnu/java/lang/management/OperatingSystemMXBeanImpl.java
@@ -39,6 +39,8 @@ package gnu.java.lang.management;
import java.lang.management.OperatingSystemMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about the underlying operating
* system.
@@ -50,7 +52,21 @@ public final class OperatingSystemMXBeanImpl
extends BeanImpl
implements OperatingSystemMXBean
{
-
+
+ /**
+ * Constructs a new <code>OperatingSystemMXBeanImpl</code>.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ public OperatingSystemMXBeanImpl()
+ throws NotCompliantMBeanException
+ {
+ super(OperatingSystemMXBean.class);
+ }
+
public String getArch()
{
return System.getProperty("os.arch");
diff --git a/gnu/java/lang/management/RuntimeMXBeanImpl.java b/gnu/java/lang/management/RuntimeMXBeanImpl.java
index 2e02cc561..e3ebd162e 100644
--- a/gnu/java/lang/management/RuntimeMXBeanImpl.java
+++ b/gnu/java/lang/management/RuntimeMXBeanImpl.java
@@ -49,6 +49,8 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about the virtual machine.
*
@@ -69,6 +71,20 @@ public final class RuntimeMXBeanImpl
private boolean bootClassPathSupported = true;
+ /**
+ * Constructs a new <code>RuntimeMXBeanImpl</code>.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
+ */
+ public RuntimeMXBeanImpl()
+ throws NotCompliantMBeanException
+ {
+ super(RuntimeMXBean.class);
+ }
+
public String getBootClassPath()
{
checkMonitorPermissions();
diff --git a/gnu/java/lang/management/ThreadMXBeanImpl.java b/gnu/java/lang/management/ThreadMXBeanImpl.java
index f788fd5b3..609b58da7 100644
--- a/gnu/java/lang/management/ThreadMXBeanImpl.java
+++ b/gnu/java/lang/management/ThreadMXBeanImpl.java
@@ -42,6 +42,8 @@ import gnu.classpath.SystemProperties;
import java.lang.management.ThreadInfo;
import java.lang.management.ThreadMXBean;
+import javax.management.NotCompliantMBeanException;
+
/**
* Provides access to information about the threads
* of the virtual machine. An instance of this bean is
@@ -96,9 +98,16 @@ public final class ThreadMXBeanImpl
* Default constructor to set up flag states. The
* VM has to specify whether time monitoring is initially
* enabled or not.
+ *
+ * @throws NotCompliantMBeanException if this class doesn't implement
+ * the interface or a method appears
+ * in the interface that doesn't comply
+ * with the naming conventions.
*/
public ThreadMXBeanImpl()
+ throws NotCompliantMBeanException
{
+ super(ThreadMXBean.class);
timeEnabled = Boolean.parseBoolean(SystemProperties.getProperty(TIME_ENABLED));
contentionEnabled = false;
}