code: private static SimpleStatsProducer<MBeanStats> buildProducer(MBeanServer server, ObjectInstance mBean) {
  
          final ObjectName mBeanName = mBean.getObjectName();
          final String canonicalName = mBeanName.getCanonicalName();
  
          final String producerId = normalize(canonicalName);
          final String subsystem = normalize(mBeanName.getDomain());
  
          try {
  
              MBeanStats stats = MBeanStatsFactory.createMBeanStats(
                      server,
                      mBeanName,
                      conf.isUpdateAutomatically(),
                      conf.getDelayBeforeFirstUpdate()
              );
  
              if(stats != null)
                  return new SimpleStatsProducer<>(
                          producerId, "mbean", subsystem, Collections.singletonList(stats)
                  );
  
  
              log.info("Failed to create stats object from mbean named " + mBean +
                      " because no one attribute can not be parsed from that been");
              return null;
  
  
  
          } catch (JMException e) {
              log.warn("Failed to create stats object from mbean named " + mBean, e);
              return null;
          }
  
      }
docs: Builds producer from given mbean.
  Producer be registered only if mbean contains at least one
  readable by moskito attribute. Only primitive types of
  attributes can be read: int, long, double, boolean and String.
  Also registers this producer in producers registry if `isRegisterAutomatically`
  property of mbean producers configuration set to true.
  
  @param server mbean server where mbean is stored
  @param mBean mbean to register identifier