code: private synchronized FileServiceMXBean getFileService() {
          if (fileService == null) {
              try {
                  fileService = JMX.newMXBeanProxy(ManagementFactory.getPlatformMBeanServer(), new ObjectName(FileServiceMXBean.OBJECT_NAME), FileServiceMXBean.class);
              } catch (MalformedObjectNameException e) {
                  throw ErrorHelper.createRESTHandlerJsonException(e, null, APIConstants.STATUS_INTERNAL_SERVER_ERROR);
              } catch (NullPointerException e) {
                  throw ErrorHelper.createRESTHandlerJsonException(e, null, APIConstants.STATUS_INTERNAL_SERVER_ERROR);
              }
          }
  
          return fileService;
      }
docs: File Service MXBean