/** * * Adds config property to the map * * @param configProperties map * @param reader XMLStream reader * @throws XMLStreamException in case of error * @throws ParserException in case of error */ protected void parseConfigProperty(Map<String, String> configProperties, XMLStreamReader reader) throws XMLStreamException, ParserException { String n = attributeAsString(reader, "name"); if (n == null || n.trim().equals("")) throw new ParserException(bundle.requiredAttributeMissing("name", reader.getLocalName())); else configProperties.put(n, elementAsString(reader)); }
/** * convert an xml element in String value * * @param reader the StAX reader * @return the string representing element * @throws XMLStreamException StAX exception */ protected String elementAsString(XMLStreamReader reader) throws XMLStreamException { String elementtext = rawElementText(reader); return getSubstitutionValue(elementtext); }
/** * convert an xml element in String value * * @param reader the StAX reader * @param attributeName the name of the attribute * @return the string representing element * @throws XMLStreamException StAX exception */ protected String attributeAsString(XMLStreamReader reader, String attributeName) throws XMLStreamException { String attributeString = rawAttributeText(reader, attributeName); return getSubstitutionValue(attributeString); }
maxPoolSize = elementAsInteger(reader); break; initialPoolSize = elementAsInteger(reader); break; minPoolSize = elementAsInteger(reader); break; interleaving = elementAsBoolean(reader); break; isSameRmOverride = elementAsBoolean(reader); break; noTxSeparatePool = elementAsBoolean(reader); break; padXid = elementAsBoolean(reader); break; wrapXaDataSource = elementAsBoolean(reader); break; prefill = elementAsBoolean(reader); break; useStrictMin = elementAsBoolean(reader); break;
noRecovery = attributeAsBoolean(reader, attribute.getLocalName(), Boolean.FALSE); break; security = parseCredential(reader); break; plugin = parseExtension(reader, tag.getLocalName()); break;
validateOnMatch = elementAsBoolean(reader); break; backgroundValidationMillis = elementAsLong(reader); break; backgroundValidation = elementAsBoolean(reader); break; useFastFail = elementAsBoolean(reader); break;
allocationRetryWaitMillis = elementAsLong(reader); break; allocationRetry = elementAsInteger(reader); break; blockingTimeoutMillis = elementAsLong(reader); break; idleTimeoutMinutes = elementAsLong(reader); break; if (isXa != null && Boolean.FALSE.equals(isXa)) throw new ParserException(bundle.unsupportedElement(reader.getLocalName())); xaResourceTimeout = elementAsInteger(reader); break;
securityDomain = elementAsString(reader); break; securityDomainAndApplication = elementAsString(reader); break; application = elementAsBoolean(reader); break;
className = attributeAsString(reader, attribute.getLocalName()); break; if (properties == null) properties = new HashMap<String, String>(); parseConfigProperty(properties, reader); break;
password = elementAsString(reader); break; userName = elementAsString(reader); break; securityDomain = elementAsString(reader); break;
maxPoolSize = elementAsInteger(reader); break; minPoolSize = elementAsInteger(reader); break; initialPoolSize = elementAsInteger(reader); break; prefill = elementAsBoolean(reader); break; useStrictMin = elementAsBoolean(reader); break; flushStrategy = elementAsFlushStrategy(reader); break; capacity = parseCapacity(reader); break;
/** * convert an xml element in String value * * @param reader the StAX reader * @param attributeName the name of the attribute * @return the string representing element * @throws XMLStreamException StAX exception */ protected Integer attributeAsInt(XMLStreamReader reader, String attributeName) throws XMLStreamException { String attributeString = getSubstitutionValue(rawAttributeText(reader, attributeName)); return attributeString != null ? Integer.valueOf(getSubstitutionValue(attributeString)) : null; }
/** * convert an xml element in boolean value. Empty elements results with true (tag presence is sufficient condition) * * @param reader the StAX reader * @return the boolean representing element * @throws XMLStreamException StAX exception * @throws ParserException in case of non valid boolean for given element value */ protected Boolean elementAsBoolean(XMLStreamReader reader) throws XMLStreamException, ParserException { String elementtext = rawElementText(reader); String stringValue = getSubstitutionValue(elementtext); if (stringValue == null || stringValue.length() == 0 || stringValue.trim().equalsIgnoreCase("true") || stringValue.trim().equalsIgnoreCase("false")) { return stringValue == null || stringValue.length() == 0 ? Boolean.TRUE : Boolean.valueOf(stringValue.trim()); } else { throw new ParserException(bundle.elementAsBoolean(elementtext, reader.getLocalName())); } }
/** * convert an xml attribute in boolean value. Empty elements results with false * * @param reader the StAX reader * @param attributeName the name of the attribute * @param defaultValue defaultValue * @return the boolean representing element * @throws XMLStreamException StAX exception * @throws ParserException in case of not valid boolena for given attribute */ protected Boolean attributeAsBoolean(XMLStreamReader reader, String attributeName, Boolean defaultValue) throws XMLStreamException, ParserException { String attributeString = rawAttributeText(reader, attributeName); String stringValue = getSubstitutionValue(attributeString); if (stringValue == null || stringValue.length() == 0 || stringValue.trim().equalsIgnoreCase("true") || stringValue.trim().equalsIgnoreCase("false")) { return attributeString == null ? defaultValue : Boolean.valueOf(reader.getAttributeValue("", attributeName).trim()); } else { throw new ParserException(bundle.attributeAsBoolean(attributeString, reader.getLocalName())); } }
/** * convert an xml element in Integer value * * @param reader the StAX reader * @return the integer representing element * @throws XMLStreamException StAX exception * @throws ParserException in case it isn't a number */ protected Integer elementAsInteger(XMLStreamReader reader) throws XMLStreamException, ParserException { Integer integerValue; integerValue = null; String elementtext = rawElementText(reader); try { integerValue = Integer.valueOf(getSubstitutionValue(elementtext)); } catch (NumberFormatException nfe) { throw new ParserException(bundle.notValidNumber(elementtext, reader.getLocalName())); } return integerValue; }
/** * convert an xml element in Long value * * @param reader the StAX reader * @return the long representing element * @throws XMLStreamException StAX exception * @throws ParserException in case it isn't a number */ protected Long elementAsLong(XMLStreamReader reader) throws XMLStreamException, ParserException { Long longValue; longValue = null; String elementtext = rawElementText(reader); try { longValue = Long.valueOf(getSubstitutionValue(elementtext)); } catch (NumberFormatException nfe) { throw new ParserException(bundle.notValidNumber(elementtext, reader.getLocalName())); } return longValue; }
/** * convert an xml element in FlushStrategy value * * @param reader the StAX reader * @return the flush strategy represention * @throws XMLStreamException StAX exception * @throws ParserException in case it isn't a number */ protected FlushStrategy elementAsFlushStrategy(XMLStreamReader reader) throws XMLStreamException, ParserException { String elementtext = rawElementText(reader); FlushStrategy result = FlushStrategy.forName(getSubstitutionValue(elementtext)); if (result != FlushStrategy.UNKNOWN) return result; throw new ParserException(bundle.notValidFlushStrategy(elementtext)); }