1 22 package org.jboss.system.deployers; 23 24 import org.jboss.deployers.plugins.deployers.helpers.XSLDeployer; 25 import org.jboss.deployers.spi.DeploymentException; 26 import org.jboss.deployers.spi.deployer.DeploymentUnit; 27 import org.jboss.system.metadata.ServiceDeployment; 28 import org.jboss.system.metadata.ServiceDeploymentParser; 29 import org.jboss.virtual.VirtualFile; 30 import org.w3c.dom.Document ; 31 32 public class ServiceXSLDeployer extends XSLDeployer<ServiceDeployment> 33 { 34 35 private String suffix; 36 37 40 public ServiceXSLDeployer() 41 { 42 super(ServiceDeployment.class); 43 } 44 45 50 public String getSuffix() 51 { 52 return suffix; 53 } 54 55 60 public void setSuffix(String suffix) 61 { 62 this.suffix = suffix; 63 } 64 65 protected ServiceDeployment parse(DeploymentUnit unit, VirtualFile file, Document document) throws Exception 66 { 67 ServiceDeploymentParser parser = new ServiceDeploymentParser(document); 68 ServiceDeployment parsed = parser.parse(); 69 String name = file.toURI().toString(); 70 parsed.setName(name); 71 return parsed; 72 } 73 74 public void deploy(DeploymentUnit unit) throws DeploymentException 75 { 76 createMetaData(unit, null, getSuffix()); 77 } 78 } 79 | Popular Tags |