diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2007-02-19 01:34:57 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2007-02-19 01:34:57 +0000 |
commit | ecb0537c5149f19f142c45e7f7cd3c7488390647 (patch) | |
tree | e0df006f17c4f257922235fced5de8660f03d389 /javax | |
parent | 969df994a5d2d60801f5aad9da9edfc583629434 (diff) | |
download | classpath-ecb0537c5149f19f142c45e7f7cd3c7488390647.tar.gz |
2007-02-19 Andrew John Hughes <gnu_andrew@member.fsf.org>
* javax/management/MBeanServer.java:
(queryMBeans(ObjectName,QueryExp)): Returned
generically-typed Set.
(queryNames(ObjectName,QueryExp)): Likewise.
* javax/management/MBeanServerConnection.java:
(queryMBeans(ObjectName,QueryExp)): Returned
generically-typed Set.
(queryNames(ObjectName,QueryExp)): Likewise.
* javax/management/ObjectName.java:
Use a generically-typed TreeMap.
(ObjectName(String,Hashtable<String,String>):
Genericized.
(getKeyPropertyList()): Likewise.
* javax/management/StandardMBean.java:
Use a generically-typed interface class.
(StandardMBean(Class<?>)): Genericized.
(StandardMBean(T, Class<T>)): Likewise.
(getImplementationClass()): Likewise.
(getMBeanInterface()): Likewise.
Diffstat (limited to 'javax')
-rw-r--r-- | javax/management/MBeanServer.java | 4 | ||||
-rw-r--r-- | javax/management/MBeanServerConnection.java | 4 | ||||
-rw-r--r-- | javax/management/ObjectName.java | 15 | ||||
-rw-r--r-- | javax/management/StandardMBean.java | 19 |
4 files changed, 22 insertions, 20 deletions
diff --git a/javax/management/MBeanServer.java b/javax/management/MBeanServer.java index 73a28e3b8..0be5d71ad 100644 --- a/javax/management/MBeanServer.java +++ b/javax/management/MBeanServer.java @@ -890,7 +890,7 @@ public interface MBeanServer * arise from the execution of the query, in which * case that particular bean will again be excluded. */ - Set queryMBeans(ObjectName name, QueryExp query); + Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query); /** * <p> @@ -929,7 +929,7 @@ public interface MBeanServer * Note that these permissions are implied if the * <code>queryMBeans</code> permissions are available. */ - Set queryNames(ObjectName name, QueryExp query); + Set<ObjectName> queryNames(ObjectName name, QueryExp query); /** * Registers the supplied instance with the server, using the specified diff --git a/javax/management/MBeanServerConnection.java b/javax/management/MBeanServerConnection.java index dff03e8c0..cba6dacc6 100644 --- a/javax/management/MBeanServerConnection.java +++ b/javax/management/MBeanServerConnection.java @@ -533,7 +533,7 @@ public interface MBeanServerConnection * @throws IOException if an I/O error occurred in communicating with * the bean server. */ - Set queryMBeans(ObjectName name, QueryExp query) + Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) throws IOException; /** @@ -560,7 +560,7 @@ public interface MBeanServerConnection * @throws IOException if an I/O error occurred in communicating with * the bean server. */ - Set queryNames(ObjectName name, QueryExp query) + Set<ObjectName> queryNames(ObjectName name, QueryExp query) throws IOException; /** diff --git a/javax/management/ObjectName.java b/javax/management/ObjectName.java index 757b80fb2..3a0d87769 100644 --- a/javax/management/ObjectName.java +++ b/javax/management/ObjectName.java @@ -105,7 +105,7 @@ public class ObjectName /** * The properties, as key-value pairs. */ - private TreeMap properties; + private TreeMap<String,String> properties; /** * The properties as a string (stored for ordering). @@ -164,7 +164,7 @@ public class ObjectName throw new MalformedObjectNameException("A name that is not a " + "pattern must contain at " + "least one key-value pair."); - properties = new TreeMap(); + properties = new TreeMap<String,String>(); for (int a = 0; a < pairs.length; ++a) { int sep = pairs[a].indexOf('='); @@ -197,7 +197,7 @@ public class ObjectName throws MalformedObjectNameException { this.domain = domain; - properties = new TreeMap(); + properties = new TreeMap<String,String>(); properties.put(key, value); checkComponents(); } @@ -216,7 +216,7 @@ public class ObjectName * @throws NullPointerException if one of the parameters is * <code>null</code>. */ - public ObjectName(String domain, Hashtable properties) + public ObjectName(String domain, Hashtable<String,String> properties) throws MalformedObjectNameException { this.domain = domain; @@ -542,7 +542,8 @@ public class ObjectName * specifications. * @throws NullPointerException if <code>name</code> is <code>null</code>. */ - public static ObjectName getInstance(String domain, Hashtable properties) + public static ObjectName getInstance(String domain, + Hashtable<String,String> properties) throws MalformedObjectNameException { return new ObjectName(domain, properties); @@ -571,9 +572,9 @@ public class ObjectName * @return a {@link java.util.Hashtable}, containing each of the object * name's properties. */ - public Hashtable getKeyPropertyList() + public Hashtable<String,String> getKeyPropertyList() { - return new Hashtable(properties); + return new Hashtable<String,String>(properties); } /** diff --git a/javax/management/StandardMBean.java b/javax/management/StandardMBean.java index 0434a40b8..b31436c6e 100644 --- a/javax/management/StandardMBean.java +++ b/javax/management/StandardMBean.java @@ -69,7 +69,7 @@ public class StandardMBean /** * The interface for this bean. */ - private Class iface; + private Class<?> iface; /** * The implementation of the interface. @@ -94,7 +94,7 @@ public class StandardMBean * in the interface that doesn't comply * with the naming conventions. */ - protected StandardMBean(Class iface) + protected StandardMBean(Class<?> iface) throws NotCompliantMBeanException { if (iface == null) @@ -133,7 +133,7 @@ public class StandardMBean * in the interface that doesn't comply * with the naming conventions. */ - public StandardMBean(Object impl, Class iface) + public <T> StandardMBean(T impl, Class<T> iface) throws NotCompliantMBeanException { if (impl == null) @@ -143,8 +143,8 @@ public class StandardMBean String className = impl.getClass().getName(); try { - iface = Class.forName(className + "MBean", true, - impl.getClass().getClassLoader()); + this.iface = Class.forName(className + "MBean", true, + impl.getClass().getClassLoader()); } catch (ClassNotFoundException e) { @@ -154,11 +154,12 @@ public class StandardMBean " was not found.").initCause(e)); } } - if (!(iface.isInstance(impl))) + else + this.iface = iface; + if (!(this.iface.isInstance(impl))) throw new NotCompliantMBeanException("The instance, " + impl + ", is not an instance of " + iface); this.impl = impl; - this.iface = iface; } /** @@ -493,7 +494,7 @@ public class StandardMBean * * @return the implementation class. */ - public Class getImplementationClass() + public Class<?> getImplementationClass() { return impl.getClass(); } @@ -681,7 +682,7 @@ public class StandardMBean * * @return the management interface. */ - public final Class getMBeanInterface() + public final Class<?> getMBeanInterface() { return iface; } |