1 22 package org.jboss.ejb3; 23 24 import java.util.concurrent.ConcurrentHashMap ; 25 import java.util.Collection ; 26 27 33 public class JmxDeploymentScopeImpl implements DeploymentScope 34 { 35 private ConcurrentHashMap <String , Ejb3Deployment> deployments = new ConcurrentHashMap <String , Ejb3Deployment>(); 36 private String shortName; 37 private String baseName; 38 39 public JmxDeploymentScopeImpl(String shortName) 40 { 41 this.shortName = shortName; 42 int idx = shortName.lastIndexOf('.'); 43 baseName = shortName.substring(0, idx); 44 } 45 46 public Collection <Ejb3Deployment> getEjbDeployments() 47 { 48 return deployments.values(); 49 } 50 51 public void register(Ejb3Deployment deployment) 52 { 53 deployments.put(deployment.getDeploymentUnit().getShortName(), deployment); 54 } 55 56 public void unregister(Ejb3Deployment deployment) 57 { 58 deployments.remove(deployment.getDeploymentUnit().getShortName()); 59 } 60 61 public Ejb3Deployment findRelativeDeployment(String relativeName) 62 { 63 String relativeShortName = relativeName.substring(3); 64 return deployments.get(relativeShortName); 65 } 66 67 public String getShortName() 68 { 69 return shortName; 70 } 71 72 public String getBaseName() 73 { 74 return baseName; 75 } 76 77 } 78 | Popular Tags |