/** * Convenience method that may be used to generate and throw an Exception for an attempt to assign a null value to a property that * requires non-null values. * * @param propertyName The name of the property being incorrectly assigned. */ protected void blockNullAssignment(String propertyName) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(NULL_COMPONENT_PROPERTY, new Object[]{propertyName}); throw ce; }
private ConfigurationException wrapException (XPathExpressionException exception) { ConfigurationException result = new ConfigurationException(); result.setDetails(PARSER_INTERNAL_ERROR); result.setRootCause(exception); return result; }
protected void initializeDocumentBuilder() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments(true); factory.setIgnoringElementContentWhitespace(true); try { docBuilder = factory.newDocumentBuilder(); } catch (ParserConfigurationException ex) { // Error initializing configuration parser. ConfigurationException e = new ConfigurationException(); e.setMessage(PARSER_INIT_ERROR); e.setRootCause(ex); throw e; } }
private void factory(Node factory) { // Validation requiredAttributesOrElements(factory, FACTORY_REQ_CHILDREN); String id = getAttributeOrChildElement(factory, ID_ATTR); String className = getAttributeOrChildElement(factory, CLASS_ATTR); if (isValidID(id)) { FactorySettings factorySettings = new FactorySettings(id, className); // Factory Properties NodeList properties = selectNodeList(factory, PROPERTIES_ELEMENT + "/*"); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(factory)); factorySettings.addProperties(map); } ((MessagingConfiguration) config).addFactorySettings(id, factorySettings); } else { // Invalid {FACTORY_ELEMENT} id '{id}'. ConfigurationException ex = new ConfigurationException(); ex.setMessage(INVALID_ID, new Object[]{FACTORY_ELEMENT, id}); ex.setDetails(INVALID_ID); throw ex; } }
ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); throw e; ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); e.setRootCause(ex); throw e; ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); e.setRootCause(se); throw e;
public void setErrorMessage(ConfigurationException e, String path) { if (version == LIVECYCLE) { e.setMessage(11122, new Object[] { path }); } else if (version == SERVER) { // Please specify a valid ''services.configuration.file'' in web.xml. e.setMessage(11108); } else { // Please specify a valid <services/> file path in flex-config.xml. e.setMessage(11106); } }
protected void initializeDocumentBuilder() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments(true); factory.setIgnoringElementContentWhitespace(true); try { docBuilder = factory.newDocumentBuilder(); docBuilder.setEntityResolver(this); } catch (ParserConfigurationException ex) { // Error initializing configuration parser. ConfigurationException e = new ConfigurationException(); e.setMessage(PARSER_INIT_ERROR); e.setRootCause(ex); throw e; } }
private void factory(Node factory) { // Validation requiredAttributesOrElements(factory, FACTORY_REQ_CHILDREN); String id = getAttributeOrChildElement(factory, ID_ATTR); String className = getAttributeOrChildElement(factory, CLASS_ATTR); if (isValidID(id)) { FactorySettings factorySettings = new FactorySettings(id, className); // Factory Properties NodeList properties = selectNodeList(factory, PROPERTIES_ELEMENT + "/*"); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(factory)); factorySettings.addProperties(map); } ((MessagingConfiguration) config).addFactorySettings(id, factorySettings); } else { // Invalid {FACTORY_ELEMENT} id '{id}'. ConfigurationException ex = new ConfigurationException(); ex.setMessage(INVALID_ID, new Object[]{FACTORY_ELEMENT, id}); ex.setDetails(INVALID_ID); throw ex; } }
ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); throw e; ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); e.setRootCause(ex); throw e; ConfigurationException e = new ConfigurationException(); setErrorMessage(e, path); e.setRootCause(se); throw e;
public void setErrorMessage(ConfigurationException e, String path) { if (version == LIVECYCLE) { // Invalid location: ''{0}''. Please specify a valid LiveCycle Data Services Configuration file via the LiveCycle Admin UI. e.setMessage(ERR_MSG_INVALID_PATH_LIVECYCLE, new Object[] {path}); } else if (version == SERVER) { // Please specify a valid ''services.configuration.file'' in web.xml. You specified ''{0}''. This is not a valid file system path reachable via the app server and is also not a path to a resource in your J2EE application archive. e.setMessage(ERR_MSG_INVALID_PATH_SERVER, new Object[]{path}); } else { // Please specify a valid <services/> file path in flex-config.xml. e.setMessage(ERR_MSG_INVALID_PATH_CLIENT); } }
/** * Convenience method that may be used to generate and throw an Exception for an attempt to set the specified property if the * component is started. * * @param propertyName The name of the property being incorrectly assigned; included in the Exception message. */ protected void blockAssignmentWhileStarted(String propertyName) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(PROPERTY_CHANGE_AFTER_STARTUP, new Object[]{propertyName}); throw ce; }
private ConfigurationException wrapException(XPathExpressionException exception) { ConfigurationException result = new ConfigurationException(); result.setDetails(PARSER_INTERNAL_ERROR); result.setRootCause(exception); return result; } }
protected void initializeDocumentBuilder() { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setIgnoringComments(true); factory.setIgnoringElementContentWhitespace(true); try { docBuilder = factory.newDocumentBuilder(); docBuilder.setEntityResolver(this); } catch (ParserConfigurationException ex) { // Error initializing configuration parser. ConfigurationException e = new ConfigurationException(); e.setMessage(PARSER_INIT_ERROR); e.setRootCause(ex); throw e; } }
private void factory(Node factory) { // Validation requiredAttributesOrElements(factory, FACTORY_REQ_CHILDREN); String id = getAttributeOrChildElement(factory, ID_ATTR); String className = getAttributeOrChildElement(factory, CLASS_ATTR); if (isValidID(id)) { FactorySettings factorySettings = new FactorySettings(id, className); // Factory Properties NodeList properties = selectNodeList(factory, PROPERTIES_ELEMENT + "/*"); if (properties.getLength() > 0) { ConfigMap map = properties(properties, getSourceFileOf(factory)); factorySettings.addProperties(map); } ((MessagingConfiguration)config).addFactorySettings(id, factorySettings); } else { // Invalid {FACTORY_ELEMENT} id '{id}'. ConfigurationException ex = new ConfigurationException(); ex.setMessage(INVALID_ID, new Object[]{FACTORY_ELEMENT, id}); ex.setDetails(INVALID_ID); throw ex; } } }
/** * Convenience method that may be used to generate and throw an Exception for an attempt to assign a null value to a property that * requires non-null values. * * @param propertyName The name of the property being incorrectly assigned. */ protected void blockNullAssignment(String propertyName) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(NULL_COMPONENT_PROPERTY, new Object[]{propertyName}); throw ce; }
private ConfigurationException wrapException(TransformerException exception) { ConfigurationException result = new ConfigurationException(); result.setDetails(PARSER_INTERNAL_ERROR); result.setRootCause(exception); return result; }
ConfigurationException e = new ConfigurationException(); e.setMessage(11107, new Object[] {path}); throw e; ConfigurationException e = new ConfigurationException(); e.setMessage(11107, new Object[] {path}); e.setRootCause(ex); throw e; ConfigurationException e = new ConfigurationException(); e.setMessage(11107, new Object[] {path}); e.setRootCause(se); throw e;
protected void blockNegative(int n, String name) { if (n < 0) { ConfigurationException ex = new ConfigurationException(); // Invalid {0} for destination ''{1}''. {0} cannot be negative. ex.setMessage(ERR_MSG_INVALID_NEGATIVE_VALUE, new Object[]{name, destinationName}); throw ex; } } }
private ConfigurationException wrapException (XPathExpressionException exception) { ConfigurationException result = new ConfigurationException(); result.setDetails(PARSER_INTERNAL_ERROR); result.setRootCause(exception); return result; }
public FlexFactory createFactory() { try { Class c = ClassUtil.createClass(className); Object f = ClassUtil.createDefaultInstance(c, FlexFactory.class); if (f instanceof FlexFactory) { FlexFactory ff = (FlexFactory) f; ff.initialize(getId(), getProperties()); return ff; } else { ConfigurationException cx = new ConfigurationException(); cx.setMessage(11101, new Object[] { className }); throw cx; } } catch (Throwable th) { ConfigurationException cx = new ConfigurationException(); cx.setMessage(11102, new Object[] { className, th.toString() }); cx.setRootCause(th); throw cx; } } }