/** * Write file post resource * * @param path will be in the post resource * @param sb the StringBuilder we fill */ private void writeFilePostResource(StringBuilder sb, String path) { sb.append("className=\"" + DIR_RESOURCE_SET + "\" base=\""); sb.append(getFileHandler().getParent(path).replace("&", "&")); sb.append("\" internalPath=\""); sb.append(getFileHandler().getName(path).replace("&", "&")); sb.append("\" webAppMount=\"/WEB-INF/classes"); }
/** * Write file post resource * * @param path will be in the post resource * @param sb the StringBuilder we fill */ private void writeFilePostResource(StringBuilder sb, String path) { sb.append("className=\"" + DIR_RESOURCE_SET + "\" base=\""); sb.append(getFileHandler().getParent(path).replace("&", "&")); sb.append("\" internalPath=\""); sb.append(getFileHandler().getName(path).replace("&", "&")); sb.append("\" webAppMount=\"/WEB-INF/classes"); }
/** * Write file post resource * * @param path will be in the post resource * @param postResourceEl the xml element we fill */ private void writeFilePostResource(Element postResourceEl, String path) { postResourceEl.setAttribute("className", JAR_RESOURCE_SET); postResourceEl.setAttribute("base", getFileHandler().getParent(path).replace("&", "&")); postResourceEl.setAttribute("internalPath", getFileHandler().getName(path).replace("&", "&")); postResourceEl.setAttribute("webAppMount", "/WEB-INF/classes"); }
/** * Write file post resource * * @param path will be in the post resource * @param postResourceEl the xml element we fill */ private void writeFilePostResource(Element postResourceEl, String path) { postResourceEl.setAttribute("className", JAR_RESOURCE_SET); postResourceEl.setAttribute("base", getFileHandler().getParent(path).replace("&", "&")); postResourceEl.setAttribute("internalPath", getFileHandler().getName(path).replace("&", "&")); postResourceEl.setAttribute("webAppMount", "/WEB-INF/classes"); }
/** * Insert the corresponding web app element into the domain of the WebLogic server. * * @param war - web application component to configure * @param domain - Domain element of the WebLogic server */ protected void addWarToDomain(WAR war, Element domain) { Element application = domain.getOwnerDocument().createElement("Application"); domain.appendChild(application); application.setAttribute("Name", "_" + war.getContext() + "_app"); application.setAttribute("Path", getFileHandler().getParent(getAbsolutePath(war))); application.setAttribute("StagingMode", "nostage"); application.setAttribute("TwoPhase", "false"); Element webAppComponent = application.getOwnerDocument().createElement("WebAppComponent"); application.appendChild(webAppComponent); webAppComponent.setAttribute("Name", war.getContext()); webAppComponent.setAttribute("Targets", getServerName()); webAppComponent.setAttribute("URI", getURI(war)); }
/** * Insert the corresponding web app element into the domain of the WebLogic server. * * @param war - web application component to configure * @param domain - Domain element of the WebLogic server */ protected void addWarToDomain(WAR war, Element domain) { Element application = domain.getOwnerDocument().createElement("Application"); domain.appendChild(application); application.setAttribute("Name", "_" + war.getContext() + "_app"); application.setAttribute("Path", getFileHandler().getParent(getAbsolutePath(war))); application.setAttribute("StagingMode", "nostage"); application.setAttribute("TwoPhase", "false"); Element webAppComponent = application.getOwnerDocument().createElement("WebAppComponent"); application.appendChild(webAppComponent); webAppComponent.setAttribute("Name", war.getContext()); webAppComponent.setAttribute("Targets", getServerName()); webAppComponent.setAttribute("URI", getURI(war)); }
/** * Construct the shared classpath XML based on the container. * * @param container the JBoss container instance from which we'll find the JBoss installed files * to reference * @return Shared classpath XML based on the container. * @throws MalformedURLException If URL building fails. */ protected String getSharedClasspathXml(JBossInstalledLocalContainer container) throws MalformedURLException { String[] sharedClassPath = container.getSharedClasspath(); StringBuilder tmp = new StringBuilder(); if (sharedClassPath != null) { for (String element : sharedClassPath) { String fileName = getFileHandler().getName(element); String directoryName = getFileHandler().getParent(element); URL directoryUrl = new File(directoryName).toURI().toURL(); tmp.append("<classpath codebase=\"" + directoryUrl + "\" archives=\"" + fileName + "\"/>"); tmp.append("\n"); } } String sharedClassPathString = tmp.toString(); getLogger().debug("Shared loader classpath is " + sharedClassPathString, getClass().getName()); return sharedClassPathString; }
/** * Construct the shared classpath XML based on the container. * * @param container the JBoss container instance from which we'll find the JBoss installed files * to reference * @return Shared classpath XML based on the container. * @throws MalformedURLException If URL building fails. */ protected String getSharedClasspathXml(JBossInstalledLocalContainer container) throws MalformedURLException { String[] sharedClassPath = container.getSharedClasspath(); StringBuilder tmp = new StringBuilder(); if (sharedClassPath != null) { for (String element : sharedClassPath) { String fileName = getFileHandler().getName(element); String directoryName = getFileHandler().getParent(element); URL directoryUrl = new File(directoryName).toURI().toURL(); tmp.append("<classpath codebase=\"" + directoryUrl + "\" archives=\"" + fileName + "\"/>"); tmp.append("\n"); } } String sharedClassPathString = tmp.toString(); getLogger().debug("Shared loader classpath is " + sharedClassPathString, getClass().getName()); return sharedClassPathString; }
javaHome = getFileHandler().getParent(javaHome);
javaHome = getFileHandler().getParent(javaHome);
/** * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the * WebLogic server. */ @Override public void undeploy(Deployable deployable) { XmlUtils xmlUtil = new XmlUtils(getFileHandler()); Document configXml = xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml")); List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='" + getFileHandler().getParent(getAbsolutePath(deployable)) + "']", configXml.getDocumentElement()); for (Element element : results) { configXml.removeChild(element); } this.writeConfigXml(configXml); }
/** * {@inheritDoc} undeploys files by removing their configuration to the config.xml file of the * WebLogic server. */ @Override public void undeploy(Deployable deployable) { XmlUtils xmlUtil = new XmlUtils(getFileHandler()); Document configXml = xmlUtil.loadXmlFromFile(getFileHandler().append(getDomainHome(), "config.xml")); List<Element> results = xmlUtil.selectElementsMatchingXPath("//Application[@Path='" + getFileHandler().getParent(getAbsolutePath(deployable)) + "']", configXml.getDocumentElement()); for (Element element : results) { configXml.removeChild(element); } this.writeConfigXml(configXml); }