use of org.jboss.as.connector.metadata.ironjacamar.IronJacamarParser in project wildfly by wildfly.
the class IronJacamarDeploymentParsingProcessor method process.
public static IronJacamarXmlDescriptor process(VirtualFile deploymentRoot, boolean resolveProperties) throws DeploymentUnitProcessingException {
IronJacamarXmlDescriptor xmlDescriptor = null;
if (deploymentRoot == null || !deploymentRoot.exists())
return null;
final String deploymentRootName = deploymentRoot.getName().toLowerCase(Locale.ENGLISH);
VirtualFile serviceXmlFile = null;
if (deploymentRootName.endsWith(".rar")) {
serviceXmlFile = deploymentRoot.getChild("/META-INF/ironjacamar.xml");
}
if (serviceXmlFile == null || !serviceXmlFile.exists())
return null;
InputStream xmlStream = null;
Activation result = null;
try {
xmlStream = serviceXmlFile.openStream();
IronJacamarParser ironJacamarParser = new IronJacamarParser();
ironJacamarParser.setSystemPropertiesResolved(resolveProperties);
result = ironJacamarParser.parse(xmlStream);
if (result != null) {
xmlDescriptor = new IronJacamarXmlDescriptor(result);
} else
throw ConnectorLogger.ROOT_LOGGER.failedToParseServiceXml(serviceXmlFile);
} catch (Exception e) {
throw ConnectorLogger.ROOT_LOGGER.failedToParseServiceXml(e, serviceXmlFile);
} finally {
VFSUtils.safeClose(xmlStream);
}
return xmlDescriptor;
}
Aggregations