mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-02 05:50:26 +08:00
AttributeList.java: Updated.
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. From-SVN: r122004
This commit is contained in:
parent
c47277a619
commit
b697e623a3
@ -1,3 +1,10 @@
|
||||
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
|
||||
|
@ -49,7 +49,7 @@ import java.util.ArrayList;
|
||||
* @since 1.5
|
||||
*/
|
||||
public class AttributeList
|
||||
extends ArrayList
|
||||
extends ArrayList<Object>
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user