/** * 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; }
/** * 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; }
/** * 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; }
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; } } }
/** * 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; }
/** * 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; }
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; } } }
/** * Validates the LoginManager before it is started. */ protected void validate() { if (perClientAuthentication && loginCommand instanceof AppServerLoginCommand) { // Cannot use application server authentication together with per client authentication. ConfigurationException configException = new ConfigurationException(); configException.setMessage(PER_CLIENT_ANT_APPSERVER); throw configException; } }
/** * 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; }
/** * Validates the LoginManager before it is started. */ protected void validate() { if (perClientAuthentication && loginCommand instanceof AppServerLoginCommand) { // Cannot use application server authentication together with per client authentication. ConfigurationException configException = new ConfigurationException(); configException.setMessage(PER_CLIENT_ANT_APPSERVER); throw configException; } }
/** * Validates the LoginManager before it is started. */ protected void validate() { if (perClientAuthentication && loginCommand instanceof AppServerLoginCommand) { // Cannot use application server authentication together with per client authentication. ConfigurationException configException = new ConfigurationException(); configException.setMessage(PER_CLIENT_ANT_APPSERVER); throw configException; } }
protected void validateEndpointProtocol() { if (isSecure() && !url.startsWith("https:")) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(11100, new Object[] {url, "https"}); throw ce; } } }
private void registerMessageBroker() { String mbid = getId(); synchronized (messageBrokers) { if (messageBrokers.get(mbid) != null) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(10137, new Object[] {getId() == null ? "(no value supplied)" : mbid}); throw ce; } messageBrokers.put(mbid, this); } }
/** * Validates the endpoint url scheme. */ protected void validateEndpointProtocol() { String scheme = isSecure()? getSecureProtocolScheme() : getInsecureProtocolScheme(); if (!url.startsWith(scheme)) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(ERR_MSG_INVALID_URL_SCHEME, new Object[] {url, scheme}); throw ce; } }
public void allowedAttributes(Node node, String[] allowed) { NodeList attributes = selectNodeList(node, "@*"); String unexpectedAttribute = unexpected(attributes, allowed); if (unexpectedAttribute != null) { //Unexpected attribute '{0}' found in '{1}'. ConfigurationException ex = new ConfigurationException(); Object[] args = {unexpectedAttribute, node.getNodeName(), getSourceFilename(node)}; ex.setMessage(UNEXPECTED_ATTRIBUTE, args); throw ex; } }
/** * Validates the endpoint url scheme. */ protected void validateEndpointProtocol() { String scheme = isSecure()? getSecureProtocolScheme() : getInsecureProtocolScheme(); if (!url.startsWith(scheme)) { ConfigurationException ce = new ConfigurationException(); ce.setMessage(ERR_MSG_INVALID_URL_SCHEME, new Object[] {url, scheme}); throw ce; } }
private void uuidGenerator(Node system, SystemSettings settings) { Node uuidGenerator = selectSingleNode(system, UUID_GENERATOR_ELEMENT); if (uuidGenerator == null) return; requiredAttributesOrElements(uuidGenerator, UUID_GENERATOR_REQ_CHILDREN); String className = getAttributeOrChildElement(uuidGenerator, CLASS_ATTR); if (className.length() == 0) { // Class not specified for {UUID_GENERATOR_ELEMENT} '{id}'. ConfigurationException ex = new ConfigurationException(); ex.setMessage(CLASS_NOT_SPECIFIED, new Object[]{UUID_GENERATOR_ELEMENT, ""}); throw ex; } settings.setUUIDGeneratorClassName(className); }
protected void validate() { if (isValid()) return; super.validate(); if (log == null) { invalidate(); ConfigurationException ex = new ConfigurationException(); ex.setMessage(NULL_LOG_REF_EXCEPTION, new Object[]{}); throw ex; } }
protected void validate() { if (isValid()) return; super.validate(); if (log == null) { invalidate(); ConfigurationException ex = new ConfigurationException(); ex.setMessage(NULL_LOG_REF_EXCEPTION, new Object[]{}); throw ex; } }
protected void validate() { if (isValid()) return; super.validate(); if (log == null) { invalidate(); ConfigurationException ex = new ConfigurationException(); ex.setMessage(NULL_LOG_REF_EXCEPTION, new Object[]{}); throw ex; } }