GlobalConfiguration globalCfg = gcr.getGlobalConfiguration();
MBeanServer mBeanServer = JmxUtil.lookupMBeanServer(globalCfg);
String groupName = "type=RemoteQuery,name=" + ObjectName.quote(cacheManagerName);
String jmxDomain = JmxUtil.buildJmxDomain(globalCfg, mBeanServer, groupName);
ComponentMetadataRepo metadataRepo = gcr.getComponentMetadataRepo();
ManageableComponentMetadata metadata = metadataRepo.findComponentMetadata(ProtobufMetadataManager.class)
.toManageableComponentMetadata();
try {
ResourceDMBean mBean = new ResourceDMBean(protobufMetadataManager, metadata);
ObjectName objName = new ObjectName(jmxDomain + ":" + groupName + ",component=" + metadata.getJmxObjectName());
protobufMetadataManager.setObjectName(objName);