/** * Get module artifact name for dependency. * @param jarFile JAR resource representing module. * @param fileHandler File handler. * @return Artifact name of module representing this dependency. */ private static String getModuleArtifactName(String jarFile, FileHandler fileHandler) { String moduleName = fileHandler.getName(jarFile); // Strip extension from JAR file to get module name moduleName = moduleName.substring(0, moduleName.lastIndexOf('.')); // CARGO-1091: JBoss expects subdirectories when the module name contains dots. // Replace all dots with minus to keep a version separator. moduleName = moduleName.replace('.', '-'); return moduleName; }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { FileHandler fileHandler = new DefaultFileHandler(); propertiesMap.put("cargo.library.shared.path.absolute", sharedLibraryPath); propertiesMap.put("cargo.library.shared.id", fileHandler.getName(sharedLibraryPath)); } }
/** * Write jar post resource * * @param path will be in the post resource * @param sb the StringBuilder we fill */ private void writeJarPostResource(StringBuilder sb, String path) { sb.append("className=\"" + FILE_RESOURCE_SET + "\" base=\""); sb.append(path.replace("&", "&")); sb.append("\" webAppMount=\"/WEB-INF/lib/"); sb.append(getFileHandler().getName(path).replace("&", "&")); }
/** * Write jar post resource * * @param path will be in the post resource * @param postResourceEl the xml element we fill */ private void writeJarPostResource(Element postResourceEl, String path) { postResourceEl.setAttribute("className", FILE_RESOURCE_SET); postResourceEl.setAttribute("base", path.replace("&", "&")); postResourceEl.setAttribute("webAppMount", "/WEB-INF/lib/" + getFileHandler().getName(path).replace("&", "&")); }
/** * Write jar post resource * * @param path will be in the post resource * @param sb the StringBuilder we fill */ private void writeJarPostResource(StringBuilder sb, String path) { sb.append("className=\"" + FILE_RESOURCE_SET + "\" base=\""); sb.append(path.replace("&", "&")); sb.append("\" webAppMount=\"/WEB-INF/lib/"); sb.append(getFileHandler().getName(path).replace("&", "&")); }
/** * Write jar post resource * * @param path will be in the post resource * @param postResourceEl the xml element we fill */ private void writeJarPostResource(Element postResourceEl, String path) { postResourceEl.setAttribute("className", FILE_RESOURCE_SET); postResourceEl.setAttribute("base", path.replace("&", "&")); postResourceEl.setAttribute("webAppMount", "/WEB-INF/lib/" + getFileHandler().getName(path).replace("&", "&")); }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { FileHandler fileHandler = new DefaultFileHandler(); propertiesMap.put("cargo.library.shared.id", fileHandler.getName(sharedLibraryPath)); propertiesMap.put("cargo.deployable.id", deployable.getName()); } }
/** * 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"); }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.group", groupRole); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.group", groupRole); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.user.name", user.getName()); propertiesMap.put("cargo.weblogic.group", groupRole); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.user.name", user.getName()); propertiesMap.put("cargo.weblogic.group", groupRole); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.user.name", user.getName()); String escapedPassword = JythonUtils.escapeStringLiteral(user.getPassword()); propertiesMap.put("cargo.weblogic.user.password", escapedPassword); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
/** * Test the {@link FileHandler#getName(java.lang.String)} method. * @throws Exception If anything goes wrong. */ public void testGetName() throws Exception { assertEquals("file.txt", this.fileHandler.getName("ram:///some/file.txt")); }
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { propertiesMap.put("cargo.weblogic.user.name", user.getName()); String escapedPassword = JythonUtils.escapeStringLiteral(user.getPassword()); propertiesMap.put("cargo.weblogic.user.password", escapedPassword); LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); } }
/** * {@inheritDoc} */ @Override public void undeploy(Deployable deployable) { List<String> args = new ArrayList<String>(); this.addConnectOptions(args); args.add("undeploy"); this.addUndeploymentArguments(args); // not too sure how asadmin determines 'name' args.add(this.cutExtension(this.getFileHandler().getName(deployable.getFile()))); // The return value is checked by GlassFish3xAsAdmin.invokeAsAdmin this.getLocalContainer().invokeAsAdmin(false, args); }