* The convention used for a {@link org.apache.camel.Service Service} ObjectName is
* <tt><domain>:context=<context-name>,type=service,name=<service-name></tt>
*/
public ObjectName getObjectName(CamelContext context, ManagedService mbean) throws MalformedObjectNameException {
String serviceBranch;
Service service = mbean.getService();
if (service instanceof Consumer) {
serviceBranch = TYPE_CONSUMER;
} else {
return null;
}
StringBuffer buffer = new StringBuffer();
buffer.append(domainName).append(":");
buffer.append(KEY_CONTEXT + "=").append(getContextId(context)).append(",");
buffer.append(KEY_TYPE + "=" + serviceBranch + ",");
buffer.append(KEY_NAME + "=")
.append(service.getClass().getSimpleName())
.append("(0x").append(Integer.toHexString(mbean.getService().hashCode())).append(")");
return createObjectName(buffer);
}