1 22 package org.jboss.deployment; 23 24 import java.util.Map ; 25 26 import javax.management.ObjectName ; 27 28 import org.jboss.mx.util.ObjectNameFactory; 29 import org.jboss.system.ServiceMBeanSupport; 30 31 import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap; 32 33 43 public class EARDeployment 44 extends ServiceMBeanSupport 45 implements EARDeploymentMBean 46 { 47 49 public static final String BASE_EAR_DEPLOYMENT_NAME = "jboss.j2ee:service=EARDeployment"; 50 51 public static final ObjectName EAR_DEPLOYMENT_QUERY_NAME = ObjectNameFactory.create(BASE_EAR_DEPLOYMENT_NAME + ",*"); 52 53 55 private DeploymentInfo deploymentInfo; 56 private ConcurrentReaderHashMap metadata = new ConcurrentReaderHashMap(); 57 58 60 public static String getJMXName(J2eeApplicationMetaData metaData, DeploymentInfo di) 61 { 62 String name = metaData.getJMXName(); 63 if( name == null ) 64 name = BASE_EAR_DEPLOYMENT_NAME + ",url='" + di.shortName + "'"; 65 return name; 66 } 67 68 70 public EARDeployment(final DeploymentInfo di) 71 { 72 this.deploymentInfo = di; 73 } 74 75 77 public String getJMXName() throws Exception 78 { 79 J2eeApplicationMetaData metaData = (J2eeApplicationMetaData) deploymentInfo.metaData; 80 return getJMXName(metaData, deploymentInfo); 81 } 82 83 87 public Object resolveMetaData(Object key) 88 { 89 return metadata.get(key); 90 } 91 92 96 public void addMetaData(Object key, Object value) 97 { 98 metadata.put(key, value); 99 } 100 101 105 public Map getMetaData() 106 { 107 return metadata; 108 } 109 } 110 | Popular Tags |