1 26 27 package org.objectweb.jonas.webapp.jonasadmin.service.ejb; 28 29 import javax.management.ObjectName ; 30 31 import org.objectweb.jonas.jmx.JonasManagementRepr; 32 import org.objectweb.jonas.webapp.jonasadmin.common.NameItem; 33 34 public class EjbItem implements NameItem { 35 36 38 public final static String EJB_ENT_STRING = "Ent"; 41 public final static String EJB_SBF_STRING = "Sbf"; 42 public final static String EJB_SBL_STRING = "Sbl"; 43 public final static String EJB_MDB_STRING = "Mdb"; 44 45 47 private String type = null; private String filename = null; 49 private String name = null; 50 private String typeString = null; private String objectName = null; 53 54 56 public EjbItem() { 57 type = null; 58 filename = null; 59 name = null; 60 objectName = null; 61 } 62 public EjbItem(ObjectName p_On) 63 throws Exception { 64 setName(p_On.getKeyProperty("name")); 65 setType(p_On.getKeyProperty("j2eeType")); 66 String fname = (String ) JonasManagementRepr.getAttribute(p_On, "fileName"); 67 setFilename(fname); 68 setObjectName(p_On.toString()); 69 } 70 71 73 public String getType() { 74 return type; 75 } 76 77 public void setType(String type) { 78 this.type = type; 79 if (type.equals("StatelessSessionBean")) { 80 typeString = EJB_SBL_STRING; 81 } else if (type.equals("StatefulSessionBean")) { 82 typeString = EJB_SBF_STRING; 83 } else if (type.equals("EntityBean")) { 84 typeString = EJB_ENT_STRING; 85 } else if (type.equals("MessageDrivenBean")) { 86 typeString = EJB_MDB_STRING; 87 } else { 88 typeString = "?"; 89 } 90 } 91 92 public String getName() { 93 return name; 94 } 95 96 public void setName(String name) { 97 this.name = name; 98 } 99 100 public String getObjectName() { 101 return objectName; 102 } 103 104 public void setObjectName(String objectName) { 105 this.objectName = objectName; 106 } 107 108 public String getFilename() { 109 return filename; 110 } 111 112 public void setFilename(String filename) { 113 this.filename = filename; 114 } 115 116 public String getTypeString() { 117 return typeString; 118 } 119 } 120 | Popular Tags |