List of usage examples for javax.management AttributeNotFoundException getMessage
public String getMessage()
From source file:org.webcurator.core.profiles.HeritrixProfile.java
/** * Adds a simple element to a map. //from ww w.ja v a2s. com * @param complexElementName The name of the map. * @param child The child element to add. * @throws InvalidAttributeValueException if the map doesn't accept simple elements. * @throws DuplicateNameException if the key is a duplicate of an existing key. */ public void addMapElement(String complexElementName, SimpleType child) throws InvalidAttributeValueException, DuplicateNameException { try { ComplexProfileElement elem = (ComplexProfileElement) getElement(complexElementName); MapType map = (MapType) elem.getValue(); map.addElement(crawlerSettings, child); } catch (AttributeNotFoundException ex) { throw new WCTRuntimeException("Element " + complexElementName + " not found in profile"); } catch (IllegalArgumentException ex) { if (ex.getMessage().startsWith("Duplicate field:")) { log.warn(ex); throw new DuplicateNameException(ex, ex.getMessage().substring("Duplicate field: ".length())); } else { throw new WCTRuntimeException(ex); } } }