@Override public Object marshal(ServiceDeploymentClassPath path) throws Exception { if(path == null) return null; Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Element classPath = document.createElement("classpath"); classPath.setAttribute("codebase", path.getCodeBase()); classPath.setAttribute("archives", path.getArchives()); return classPath; } }
@Override public ServiceDeploymentClassPath unmarshal(Object e) throws Exception { Element classpathElement = (Element) e; if (classpathElement.hasAttribute("codebase") == false) throw new ConfigurationException("Invalid classpath element missing codebase: " + classpathElement); String codebase = classpathElement.getAttribute("codebase").trim(); codebase = StringPropertyReplacer.replaceProperties(codebase); String archives = null; if (classpathElement.hasAttribute("archives")) { archives = classpathElement.getAttribute("archives").trim(); archives = StringPropertyReplacer.replaceProperties(archives); if ("".equals(archives)) archives = null; } return new ServiceDeploymentClassPath(codebase, archives); }
@Override public ServiceDeploymentClassPath unmarshal(Object e) throws Exception { Element classpathElement = (Element) e; if (classpathElement.hasAttribute("codebase") == false) throw new ConfigurationException("Invalid classpath element missing codebase: " + classpathElement); String codebase = classpathElement.getAttribute("codebase").trim(); codebase = StringPropertyReplacer.replaceProperties(codebase); String archives = null; if (classpathElement.hasAttribute("archives")) { archives = classpathElement.getAttribute("archives").trim(); archives = StringPropertyReplacer.replaceProperties(archives); if ("".equals(archives)) archives = null; } return new ServiceDeploymentClassPath(codebase, archives); }
@Override public Object marshal(ServiceDeploymentClassPath path) throws Exception { if(path == null) return null; Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Element classPath = document.createElement("classpath"); classPath.setAttribute("codebase", path.getCodeBase()); classPath.setAttribute("archives", path.getArchives()); return classPath; } }
classPaths = new ArrayList<ServiceDeploymentClassPath>(); ServiceDeploymentClassPath classPath = new ServiceDeploymentClassPath(codebase, archives); classPaths.add(classPath);
String codebase = path.getCodeBase(); String archives = path.getArchives();
classPaths = new ArrayList<ServiceDeploymentClassPath>(); ServiceDeploymentClassPath classPath = new ServiceDeploymentClassPath(codebase, archives); classPaths.add(classPath);