1 7 8 package org.jboss.media.engine; 9 10 import java.io.File ; 11 import java.net.URL ; 12 13 import org.dom4j.DocumentException; 14 import org.dom4j.io.SAXReader; 15 import org.jboss.deployment.DeploymentException; 16 import org.jboss.deployment.DeploymentInfo; 17 import org.jboss.deployment.SubDeployer; 18 import org.jboss.deployment.SubDeployerSupport; 19 20 26 public class MediaEngineDeployer 27 extends SubDeployerSupport 28 implements SubDeployer, MediaEngineDeployerMBean 29 { 30 public MediaEngineDeployer() 31 { 32 } 33 34 37 public boolean accepts(DeploymentInfo info) 38 { 39 40 String urlStr = info.url.toString(); 41 return (urlStr.endsWith("-media.xml")); 42 } 43 44 protected boolean isDeployable(String name, URL url) 45 { 46 return (name.endsWith("-media.xml")); 47 } 48 49 public void init(DeploymentInfo di) throws DeploymentException 50 { 51 super.init(di); 53 54 boolean debug = log.isDebugEnabled(); 55 56 try 57 { 58 if (di.watch == null) 59 { 60 if (di.url.getProtocol().equals("file")) 62 { 63 File file = new File (di.url.getFile()); 64 65 if (!file.isDirectory()) 67 { 68 di.watch = di.url; 69 } 70 } 71 else 72 { 73 di.watch = di.url; 75 } 76 } 77 parseDocument(di); 79 } 80 catch (Exception e) 81 { 82 log.error("failed to parse media document: ", e); 83 throw new DeploymentException(e); 84 } 85 } 86 87 90 private void parseDocument(DeploymentInfo di) 91 throws DeploymentException, DocumentException 92 { 93 110 111 } 112 113 116 public synchronized void create(DeploymentInfo di) 117 throws DeploymentException 118 { 119 120 super.create(di); 121 log.info("Deploying *-media.xml descriptor"); 122 } 123 124 127 public void start(DeploymentInfo di) throws DeploymentException 128 { 129 144 } 145 146 149 public synchronized void stop(DeploymentInfo di) throws DeploymentException 150 { 151 163 } 164 } 165 | Popular Tags |