use of org.jboss.metadata.appclient.parser.jboss.JBossClientMetaDataParser in project wildfly by wildfly.
the class ApplicationClientParsingDeploymentProcessor method parseJBossClient.
private JBossClientMetaData parseJBossClient(DeploymentUnit deploymentUnit, final PropertyReplacer propertyReplacer) throws DeploymentUnitProcessingException {
final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
final VirtualFile appXml = deploymentRoot.getChild(JBOSS_CLIENT_XML);
if (appXml.exists()) {
InputStream is = null;
try {
is = appXml.openStream();
JBossClientMetaData data = new JBossClientMetaDataParser().parse(getXMLStreamReader(is), propertyReplacer);
return data;
} catch (XMLStreamException e) {
throw AppClientLogger.ROOT_LOGGER.failedToParseXml(e, appXml, e.getLocation().getLineNumber(), e.getLocation().getColumnNumber());
} catch (IOException e) {
throw AppClientLogger.ROOT_LOGGER.failedToParseXml(e, appXml);
} finally {
try {
if (is != null) {
is.close();
}
} catch (IOException e) {
// Ignore
}
}
} else {
//we may already have this info from jboss-all.xml
return deploymentUnit.getAttachment(AppClientJBossAllParser.ATTACHMENT_KEY);
}
}
Aggregations