diff options
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/classpath/ChangeLog.gcj | 7 | ||||
-rw-r--r-- | libjava/classpath/javax/management/AttributeList.java | 2 | ||||
-rw-r--r-- | libjava/classpath/javax/management/MBeanServerDelegate.java | 4 | ||||
-rw-r--r-- | libjava/classpath/javax/management/MBeanServerFactory.java | 17 | ||||
-rw-r--r-- | libjava/classpath/javax/management/StandardMBean.java | 18 | ||||
-rw-r--r-- | libjava/classpath/lib/javax/management/AttributeList.class | bin | 1795 -> 1859 bytes | |||
-rw-r--r-- | libjava/classpath/lib/javax/management/MBeanServerDelegate.class | bin | 4939 -> 4928 bytes | |||
-rw-r--r-- | libjava/classpath/lib/javax/management/MBeanServerFactory.class | bin | 6265 -> 6622 bytes | |||
-rw-r--r-- | libjava/classpath/lib/javax/management/StandardMBean.class | bin | 14040 -> 14328 bytes |
9 files changed, 30 insertions, 18 deletions
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj index a4faec8c89b..e4a71a829a5 100644 --- a/libjava/classpath/ChangeLog.gcj +++ b/libjava/classpath/ChangeLog.gcj @@ -1,5 +1,12 @@ 2007-02-15 Gary Benson <gbenson@redhat.com> + * javax/management/AttributeList.java: Updated. + * javax/management/MBeanServerDelegate.java: Likewise. + * javax/management/MBeanServerFactory.java: Likewise. + * javax/management/StandardMBean.java: Likewise. + +2007-02-15 Gary Benson <gbenson@redhat.com> + * gnu/javax/management/Server.java (registerMBean): Always register objects that implement the MBeanRegistration interface, and check the name returned by diff --git a/libjava/classpath/javax/management/AttributeList.java b/libjava/classpath/javax/management/AttributeList.java index 6823df3f28a..09db9b621ba 100644 --- a/libjava/classpath/javax/management/AttributeList.java +++ b/libjava/classpath/javax/management/AttributeList.java @@ -49,7 +49,7 @@ import java.util.ArrayList; * @since 1.5 */ public class AttributeList - extends ArrayList + extends ArrayList<Object> { /** diff --git a/libjava/classpath/javax/management/MBeanServerDelegate.java b/libjava/classpath/javax/management/MBeanServerDelegate.java index bf3f5f89420..347e51fc97c 100644 --- a/libjava/classpath/javax/management/MBeanServerDelegate.java +++ b/libjava/classpath/javax/management/MBeanServerDelegate.java @@ -69,7 +69,7 @@ public class MBeanServerDelegate /** * The listeners registered with the delegate. */ - private List listeners; + private final List listeners = new ArrayList(); /** * The sequence identifier used by the delegate. @@ -120,8 +120,6 @@ public class MBeanServerDelegate { if (listener == null) throw new IllegalArgumentException("A null listener was supplied."); - if (listeners == null) - listeners = new ArrayList(); listeners.add(new ListenerData(listener, filter, passback)); } diff --git a/libjava/classpath/javax/management/MBeanServerFactory.java b/libjava/classpath/javax/management/MBeanServerFactory.java index 8b27c46e8d7..54195635bd2 100644 --- a/libjava/classpath/javax/management/MBeanServerFactory.java +++ b/libjava/classpath/javax/management/MBeanServerFactory.java @@ -1,5 +1,5 @@ /* MBeanServerFactory.java -- Manages server instances. - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -89,7 +89,7 @@ public class MBeanServerFactory /** * The map of registered servers (identifiers to servers). */ - private static Map servers = new HashMap(); + private static final Map<Object,MBeanServer> servers = new HashMap(); /** * Private constructor to prevent instance creation. @@ -206,15 +206,15 @@ public class MBeanServerFactory * caller's permissions don't imply {@link * MBeanServerPermission(String)}("findMBeanServer") */ - public static ArrayList findMBeanServer(String id) + public static ArrayList<MBeanServer> findMBeanServer(String id) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new MBeanServerPermission("findMBeanServer")); if (id == null) return new ArrayList(servers.values()); - ArrayList list = new ArrayList(); - MBeanServer server = (MBeanServer) servers.get(id); + ArrayList<MBeanServer> list = new ArrayList<MBeanServer>(); + MBeanServer server = servers.get(id); if (server != null) list.add(servers.get(id)); return list; @@ -334,7 +334,8 @@ public class MBeanServerFactory builder.getClass() != MBeanServerBuilder.class) builder = new MBeanServerBuilder(); } - else if (!(builderClass.equals(builder.getClass().getName()))) + else if (!(builder != null && + builderClass.equals(builder.getClass().getName()))) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl == null) @@ -394,10 +395,10 @@ public class MBeanServerFactory SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new MBeanServerPermission("releaseMBeanServer")); - Iterator i = servers.values().iterator(); + Iterator<MBeanServer> i = servers.values().iterator(); while (i.hasNext()) { - MBeanServer s = (MBeanServer) i.next(); + MBeanServer s = i.next(); if (server == s) { i.remove(); diff --git a/libjava/classpath/javax/management/StandardMBean.java b/libjava/classpath/javax/management/StandardMBean.java index 16b6f0b6687..0434a40b8cc 100644 --- a/libjava/classpath/javax/management/StandardMBean.java +++ b/libjava/classpath/javax/management/StandardMBean.java @@ -107,8 +107,9 @@ public class StandardMBean catch (ClassNotFoundException e) { throw (NotCompliantMBeanException) - (new NotCompliantMBeanException("An interface for the class " + - className + " was not found.").initCause(e)); + (new NotCompliantMBeanException("An interface, " + className + + "MBean, for the class " + className + + " was not found.").initCause(e)); } } if (!(iface.isInstance(this))) @@ -142,13 +143,15 @@ public class StandardMBean String className = impl.getClass().getName(); try { - iface = Class.forName(className + "MBean"); + iface = Class.forName(className + "MBean", true, + impl.getClass().getClassLoader()); } catch (ClassNotFoundException e) { throw (NotCompliantMBeanException) - (new NotCompliantMBeanException("An interface for the class " + - className + " was not found.").initCause(e)); + (new NotCompliantMBeanException("An interface, " + className + + "MBean, for the class " + className + + " was not found.").initCause(e)); } } if (!(iface.isInstance(impl))) @@ -665,7 +668,10 @@ public class StandardMBean ainfo, cinfo, oinfo, null); String cname = getClassName(info); String desc = getDescription(info); - info = new MBeanInfo(cname, desc, ainfo, cinfo, oinfo, null); + MBeanNotificationInfo[] ninfo = null; + if (impl instanceof NotificationBroadcaster) + ninfo = ((NotificationBroadcaster) impl).getNotificationInfo(); + info = new MBeanInfo(cname, desc, ainfo, cinfo, oinfo, ninfo); cacheMBeanInfo(info); return info; } diff --git a/libjava/classpath/lib/javax/management/AttributeList.class b/libjava/classpath/lib/javax/management/AttributeList.class Binary files differindex 528918c72bf..b2402e989b5 100644 --- a/libjava/classpath/lib/javax/management/AttributeList.class +++ b/libjava/classpath/lib/javax/management/AttributeList.class diff --git a/libjava/classpath/lib/javax/management/MBeanServerDelegate.class b/libjava/classpath/lib/javax/management/MBeanServerDelegate.class Binary files differindex 325af96c49c..90130982041 100644 --- a/libjava/classpath/lib/javax/management/MBeanServerDelegate.class +++ b/libjava/classpath/lib/javax/management/MBeanServerDelegate.class diff --git a/libjava/classpath/lib/javax/management/MBeanServerFactory.class b/libjava/classpath/lib/javax/management/MBeanServerFactory.class Binary files differindex b64a82f2909..4b73417d78c 100644 --- a/libjava/classpath/lib/javax/management/MBeanServerFactory.class +++ b/libjava/classpath/lib/javax/management/MBeanServerFactory.class diff --git a/libjava/classpath/lib/javax/management/StandardMBean.class b/libjava/classpath/lib/javax/management/StandardMBean.class Binary files differindex 7657a32b757..29ed9dbc1f3 100644 --- a/libjava/classpath/lib/javax/management/StandardMBean.class +++ b/libjava/classpath/lib/javax/management/StandardMBean.class |