@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(STORE_STATE)) { if (DO_NOT_STORE_STATE.equals(newValue)){ stateful = false; relationships = statelessRelationshipSet; } else { stateful = true; relationships = statefulRelationshipSet; } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(RATE_CONTROL_CRITERIA) || descriptor.equals(RATE_CONTROL_ATTRIBUTE_NAME) || descriptor.equals(GROUPING_ATTRIBUTE_NAME) || descriptor.equals(TIME_PERIOD)) { // if the criteria that is being used to determine limits/throttles is changed, we must clear our throttle map. throttleMap.clear(); } else if (descriptor.equals(MAX_RATE)) { final long newRate; if (DataUnit.DATA_SIZE_PATTERN.matcher(newValue.toUpperCase()).matches()) { newRate = DataUnit.parseDataSize(newValue, DataUnit.B).longValue(); } else { newRate = Long.parseLong(newValue); } for (final Throttle throttle : throttleMap.values()) { throttle.setMaxRate(newRate); } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(STORE_STATE)) { if (DO_NOT_STORE_STATE.equals(newValue)){ stateful = false; relationships = statelessRelationshipSet; } else { stateful = true; relationships = statefulRelationshipSet; } } }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(RATE_CONTROL_CRITERIA) || descriptor.equals(RATE_CONTROL_ATTRIBUTE_NAME) || descriptor.equals(GROUPING_ATTRIBUTE_NAME) || descriptor.equals(TIME_PERIOD)) { // if the criteria that is being used to determine limits/throttles is changed, we must clear our throttle map. throttleMap.clear(); } else if (descriptor.equals(MAX_RATE)) { final long newRate; if (DataUnit.DATA_SIZE_PATTERN.matcher(newValue.toUpperCase()).matches()) { newRate = DataUnit.parseDataSize(newValue, DataUnit.B).longValue(); } else { newRate = Long.parseLong(newValue); } for (final Throttle throttle : throttleMap.values()) { throttle.setMaxRate(newRate); } } }
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { super.onPropertyModified(descriptor, oldValue, newValue); if (descriptor.equals(TESS_DATA_PATH)) { getLogger().debug("Tesseract Install path was changed. Building list of supported languages"); SUPPORTED_LANGUAGES.clear(); SUPPORTED_LANGUAGES.add("eng"); //File will always exist since the Validator will take care of that. File[] files = getTesseractLanguages(newValue); //Guard against creating an empty list of allowable values in case the user points to an invalid directory if (files != null && files.length > 0) { for (int i = 0; i < files.length; i++) { if (getLogger().isDebugEnabled()) { getLogger().debug("Found Tesseract supported language: " + files[i].getName()); } SUPPORTED_LANGUAGES.add(StringUtils.split(files[i].getName(), ".")[0]); } } else { getLogger().debug("No languages found in user specified Tessdata directory: '" + newValue + "'"); } } }