case SHARABLE : {
sharable = attributeAsBoolean(reader, attribute.getLocalName(), true);
break;
}
default :
throw new ParserException(bundle.unexpectedAttribute(attribute.getLocalName(), reader.getLocalName()));
}
}
if (jndiName == null || jndiName.trim().equals(""))
throw new ParserException(bundle.missingJndiName(reader.getLocalName()));
while (reader.hasNext())
{
switch (reader.nextTag())
{
case END_ELEMENT : {
if (ResourceAdapter.Tag.forName(reader.getLocalName()) == ResourceAdapter.Tag.CONNECTION_DEFINITION)
{
return new CommonConnDefImpl(configProperties, className, jndiName, poolName, enabled,
useJavaContext, useCcm, sharable, pool, timeOut, validation,
security, recovery);
}
else
{
if (CommonConnDef.Tag.forName(reader.getLocalName()) == CommonConnDef.Tag.UNKNOWN)
{
throw new ParserException(bundle.unexpectedEndTag(reader.getLocalName()));
}
}
break;
}
case START_ELEMENT : {
switch (CommonConnDef.Tag.forName(reader.getLocalName()))
{
case CONFIG_PROPERTY : {
configProperties.put(attributeAsString(reader, "name"), elementAsString(reader));
break;
}
case SECURITY : {
security = parseSecuritySettings(reader);
break;
}
case TIMEOUT : {
timeOut = parseTimeOut(reader, isXa);
break;
}
case VALIDATION : {
validation = parseValidation(reader);
break;
}
case XA_POOL : {
if (pool != null)
throw new ParserException(bundle.multiplePools());
pool = parseXaPool(reader);
isXa = true;
break;
}
case POOL : {
if (pool != null)
throw new ParserException(bundle.multiplePools());
pool = parsePool(reader);
break;
}
case RECOVERY : {
recovery = parseRecovery(reader);
break;
}
default :
throw new ParserException(bundle.unexpectedElement(reader.getLocalName()));
}
break;
}
}
}
throw new ParserException(bundle.unexpectedEndOfDocument());
}