Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cluster names should be quoted (https://issues.jboss.org/browse/JGRP-…

  • Loading branch information...
commit a484edaadf77a737bdc75262b65c4503b2e8724f 1 parent 77fb999
@belaban authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/org/jgroups/jmx/JmxConfigurator.java
View
12 src/org/jgroups/jmx/JmxConfigurator.java
@@ -44,6 +44,8 @@ public static void registerChannel(JChannel channel, MBeanServer server, String
if (cluster_name == null)
cluster_name = "null";
+ cluster_name=ObjectName.quote(cluster_name);
+
if (register_protocols) {
ProtocolStack stack = channel.getProtocolStack();
List<Protocol> protocols = stack.getProtocols();
@@ -91,6 +93,9 @@ public static void unregisterChannel(JChannel c, MBeanServer server, String clus
public static void unregisterChannel(JChannel c, MBeanServer server, String domain, String clusterName)
throws Exception {
+ if(clusterName != null)
+ clusterName=ObjectName.quote(clusterName);
+
ProtocolStack stack = c.getProtocolStack();
List<Protocol> protocols = stack.getProtocols();
for (Protocol p : protocols) {
@@ -217,19 +222,18 @@ private static void internalUnregister(Object obj, MBeanServer server, String na
}
}
- private static ObjectName getObjectName(Object obj, String name)
- throws MalformedObjectNameException {
+ private static ObjectName getObjectName(Object obj, String name) throws MalformedObjectNameException {
MBean resource = obj.getClass().getAnnotation(MBean.class);
if (name != null && name.length() > 0) {
return new ObjectName(name);
} else if (resource.objectName() != null && resource.objectName().length() > 0) {
return new ObjectName(resource.objectName());
} else {
- throw new MalformedObjectNameException("Instance " + obj + " of a class "
- + obj.getClass() + " does not have a valid object name");
+ throw new MalformedObjectNameException(obj + " of class " + obj.getClass() + " has an invalid object name");
}
}
+
/**
* Unregisters object_name and everything under it
*
Please sign in to comment.
Something went wrong with that request. Please try again.