/** Get the xml file from the URL and parse it into a Document object. * Calls new XmlFileLoader(validateDTDs).getDocumentFromURL(url); * @param url the URL from which the xml doc is to be obtained. * @return Document */ public static Document getDocument(URL url, boolean validateDTDs) throws DeploymentException { XmlFileLoader loader = new XmlFileLoader(validateDTDs); return loader.getDocumentFromURL(url); }
/** Invokes getDocument(url, defaultValidateDTDs) * */ public static Document getDocument(URL url) throws DeploymentException { return getDocument(url, defaultValidateDTDs); }
URLClassLoader cl = new URLClassLoader( new URL[] {url}, Thread.currentThread().getContextClassLoader()); XmlFileLoader xfl = new XmlFileLoader(); BeanVerifier verifier = new BeanVerifier(); xfl.setClassLoader(cl); verifier.addVerificationListener(new Listener()); verifier.verify(url, xfl.load(null));
XmlFileLoader xmlLoader = new XmlFileLoader(); String warURI = warURL.toExternalForm(); try { if (webIS != null) { Document webDoc = xmlLoader.getDocument(webIS, warURI + "/WEB-INF/web.xml"); Element web = webDoc.getDocumentElement(); Document jbossWebDoc = xmlLoader.getDocument(jbossWebIS, warURI + "/WEB-INF/jboss-web.xml"); Element jbossWeb = jbossWebDoc.getDocumentElement();
ejbjarUrl = getClassLoader().getResource("META-INF/ejb-jar.xml"); metaData = new ApplicationMetaData(realMetaData); Document ejbjarDocument = getDocumentFromURL(ejbjarUrl); try defaultJbossDocument = getDocumentFromURL(defaultJbossUrl); metaData.setUrl(defaultJbossUrl); metaData.importJbossXml(defaultJbossDocument.getDocumentElement()); URL jbossUrl = getClassLoader().getResource("META-INF/jboss.xml"); if (jbossUrl != null) Document jbossDocument = getDocumentFromURL(jbossUrl); metaData.setUrl(jbossUrl); metaData.importJbossXml(jbossDocument.getDocumentElement());
try doc = getDocument(is2, inPath);
/** Get the xml file from the URL and parse it into a Document object. * Calls getDocument(new InputSource(url.openStream()), url.getPath()) * with the InputSource.SystemId set to url.toExternalForm(). * * @param url the URL from which the xml doc is to be obtained. * @return Document */ public Document getDocumentFromURL(URL url) throws DeploymentException { InputStream is = null; try { is = url.openStream(); return getDocument(is, url.toExternalForm()); } catch (IOException e) { throw new DeploymentException("Failed to obtain xml doc from URL", e); } }
public void startService() throws Exception { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); URL stdJDBCUrl = classLoader.getResource("standardjbosscmp-jdbc.xml"); if(stdJDBCUrl == null) { throw new DeploymentException("No standardjbosscmp-jdbc.xml found"); } boolean debug = log.isDebugEnabled(); if(debug) { log.debug("Loading standardjbosscmp-jdbc.xml : " + stdJDBCUrl.toString()); } Element stdJDBCElement = XmlFileLoader.getDocument(stdJDBCUrl, true).getDocumentElement(); Element typeMaps = MetaData.getOptionalChild(stdJDBCElement, "type-mappings"); if(typeMaps != null) { for(Iterator i = MetaData.getChildrenByTagName(typeMaps, "type-mapping"); i.hasNext();) { Element typeMappingElement = (Element)i.next(); JDBCTypeMappingMetaData typeMapping = new JDBCTypeMappingMetaData(typeMappingElement); typeMappings.put(typeMapping.getName(), typeMapping); log.debug("added type-mapping: " + typeMapping.getName()); } } }
if (debug) log.debug("Loading standardjbosscmp-jdbc.xml : " + stdJDBCUrl.toString()); Element stdJDBCElement = XmlFileLoader.getDocument(stdJDBCUrl, true).getDocumentElement(); Element jdbcElement = XmlFileLoader.getDocument(jdbcUrl, true).getDocumentElement(); jamd = new JDBCApplicationMetaData(jdbcElement, jamd);