/** * Creates a new instance based on the provide properties object. Only * intended for use in unit tests. */ DefaultMonitorRegistry(Properties props) { final String className = props.getProperty(REGISTRY_CLASS_PROP); final String registryName = props.getProperty(REGISTRY_NAME_PROP, DEFAULT_REGISTRY_NAME); if (className != null) { MonitorRegistry r; try { Class<?> c = Class.forName(className); r = (MonitorRegistry) c.newInstance(); } catch (Throwable t) { LOG.error( "failed to create instance of class " + className + ", " + "using default class " + JmxMonitorRegistry.class.getName(), t); r = new JmxMonitorRegistry(registryName); } registry = r; } else { registry = new JmxMonitorRegistry(registryName, getObjectNameMapper(props)); } }
if ( "true".equalsIgnoreCase(commandLine.getOptionValue(SERVO_INTEGRATION, "false")) ) servoRegistration = new ServoRegistration(new JmxMonitorRegistry("exhibitor"), 60000);
/** * Creates a new instance based on the provide properties object. Only * intended for use in unit tests. */ DefaultMonitorRegistry(Properties props) { final String className = props.getProperty(REGISTRY_CLASS_PROP); final String registryName = props.getProperty(REGISTRY_NAME_PROP, DEFAULT_REGISTRY_NAME); if (className != null) { MonitorRegistry r; try { Class<?> c = Class.forName(className); r = (MonitorRegistry) c.newInstance(); } catch (Throwable t) { LOG.error( "failed to create instance of class " + className + ", " + "using default class " + JmxMonitorRegistry.class.getName(), t); r = new JmxMonitorRegistry(registryName); } registry = r; } else { registry = new JmxMonitorRegistry(registryName, getObjectNameMapper(props)); } }