1 23 24 package com.sun.enterprise.management.model; 25 26 import javax.management.ObjectName ; 27 import java.util.Set ; 28 29 public abstract class EJBMdl extends J2EEManagedObjectMdl { 30 31 private String ejbModuleName = null; 32 private String applicationName = null; 33 private String ejbName = null; 34 35 EJBMdl(String name, String moduleName, String appName) { 36 super(name,false, false, false); 37 this.ejbModuleName = moduleName; 38 this.applicationName = appName; 39 if(J2EEModuleMdl.isStandAloneModule(applicationName)) 40 this.applicationName = "null"; 41 this.ejbName = name; 42 } 43 44 EJBMdl(String name, String moduleName, String appName, String serverName) { 45 super(name, serverName, false, false, false); 46 this.ejbModuleName = moduleName; 47 this.applicationName = appName; 48 if(J2EEModuleMdl.isStandAloneModule(applicationName)) 49 this.applicationName = "null"; 50 this.ejbName = name; 51 } 52 53 56 public String getEJBModule(){ 57 return this.ejbModuleName; 58 } 59 62 public String getJ2EEApplication(){ 63 return this.applicationName; 64 } 65 66 70 public String getobjectName() { 71 Set s = findNames("j2eeType="+getj2eeType()+",name="+this.ejbName+",EJBModule="+this.getEJBModule()+",J2EEApplication="+this.getJ2EEApplication()+",J2EEServer="+this.getJ2EEServer()); 72 Object [] objs = s.toArray(); 73 if (objs.length > 0) { 74 String name = ((ObjectName )objs[0]).toString(); 75 return name; 76 } else { 77 return null; 78 } 79 } 80 } 81 | Popular Tags |