private int getPersistPolicy(Descriptor descriptor, Descriptor mbean) {
    Logger logger = getLogger();

    String persist = (String) descriptor.getFieldValue("persistPolicy");
    if (persist == null && mbean != null) {
      persist = (String) mbean.getFieldValue("persistPolicy");
    }
    if (persist == null) {
      if (logger.isEnabledFor(Logger.TRACE)) {
        logger.trace("No persist policy defined, assuming Never");
      }
      return PERSIST_NEVER;
    } else {
      if (persist.equals("Never")) {
        if (logger.isEnabledFor(Logger.TRACE)) {
          logger.trace("Persist never");
        }
        return PERSIST_NEVER;
      } else if (persist.equals("OnUpdate")) {
        if (logger.isEnabledFor(Logger.TRACE)) {
          logger.trace("Persist on update");
        }
        return PERSIST_ON_UPDATE;
      } else if (persist.equals("OnTimer")) {
        if (logger.isEnabledFor(Logger.TRACE)) {
          logger.trace("Persist on update");
        }
        return PERSIST_ON_TIMER;
      } else if (persist.equals("NoMoreOftenThan")) {
        if (logger.isEnabledFor(Logger.TRACE)) {
          Long period = getFieldTimeValue(descriptor, mbean, "persistPeriod");
          logger.trace("Persist no more often than " + period);
        }
        return PERSIST_NO_MORE_OFTEN_THAN;
      } else {
        // Garbage, assuming Never
        if (logger.isEnabledFor(Logger.TRACE)) {
          logger.trace("Invalid persist policy, assuming persist never");
        }
        return PERSIST_NEVER;
      }
    }
  }
@author <a href="mailto:biorn_steedom@users.sourceforge.net">Simone Bordet</a>
@version $Revision: 1.14 $
geode-core/src/main/java/org/apache/geode/admin/jmx/internal/MX4JModelMBean.java