1 7 8 package org.jboss.media.emb; 9 10 import java.net.URL ; 11 12 import org.dom4j.io.SAXReader; 13 import org.jboss.deployment.DeploymentException; 14 import org.jboss.deployment.DeploymentInfo; 15 import org.jboss.ejb.EJBDeployer; 16 import org.jboss.ejb.EJBDeployerMBean; 17 import org.jboss.media.engine.MediaXmlLoader; 18 19 24 public class EMBDeployer 25 extends EJBDeployer 26 implements EMBDeployerMBean, EJBDeployerMBean 27 { 28 29 public boolean accepts(DeploymentInfo di) 30 { 31 String urlStr = di.url.getFile(); 33 if (!urlStr.endsWith("jar") && !urlStr.endsWith("jar/")) 34 { 35 return false; 36 } 37 38 boolean accepts = false; 40 try 41 { 42 URL dd = di.localCl.findResource("META-INF/ejb-jar.xml"); 43 if (dd == null) 44 { 45 return false; 46 } 47 48 URL dm = di.localCl.findResource("META-INF/jboss-media.xml"); 49 if (dm == null) 50 { 51 return false; 52 } 53 54 if (di.localUrl != null) 58 { 59 urlStr = di.localUrl.toString(); 60 } 61 62 String ddStr = dd.toString(); 63 if (ddStr.indexOf(urlStr) >= 0) 64 { 65 accepts = true; 66 } 67 } 68 catch (Exception ignore) 69 { 70 } 71 72 return accepts; 73 } 74 75 78 public synchronized void create(DeploymentInfo di) 79 throws DeploymentException 80 { 81 super.create(di); 82 83 try 84 { 85 90 } 91 catch (Exception e) 92 { 93 if (e instanceof DeploymentException) 94 throw (DeploymentException) e; 95 throw new DeploymentException("Failed to load metadata", e); 96 } 97 } 98 99 102 public synchronized void start(DeploymentInfo di) throws DeploymentException 103 { 104 super.start(di); 106 } 107 108 protected void parseDocument(DeploymentInfo di) throws Exception 109 { 110 129 } 130 131 } | Popular Tags |