1 23 24 package com.sun.enterprise.management.model; 25 26 import javax.management.ObjectName ; 27 import java.util.Set ; 28 29 public class ServletMdl extends J2EEManagedObjectMdl { 30 private static String MANAGED_OBJECT_TYPE = "Servlet"; 31 32 private String webModuleName = null; 33 private String applicationName = null; 34 private String servletName = null; 35 public ServletMdl(String name, String bundleName, String appName) { 36 super(name,false,false,false); 37 this.webModuleName = bundleName; 38 this.servletName = name; 39 this.applicationName = appName; 40 if(J2EEModuleMdl.isStandAloneModule(applicationName)) 41 this.applicationName = "null"; 42 } 43 44 public ServletMdl(String name, String bundleName, String appName, String serverName) { 45 super(name,serverName,false,false,false); 46 this.webModuleName = bundleName; 47 this.servletName = name; 48 this.applicationName = appName; 49 if(J2EEModuleMdl.isStandAloneModule(applicationName)) 50 this.applicationName = "null"; 51 } 52 53 54 57 public String getj2eeType() { 58 return MANAGED_OBJECT_TYPE; 59 } 60 61 65 public String getobjectName() { 66 Set s = findNames("j2eeType="+getj2eeType()+",name="+this.servletName+",WebModule="+this.getWebModule()+",J2EEApplication="+this.getJ2EEApplication()+",J2EEServer="+this.getJ2EEServer()); 67 Object [] objs = s.toArray(); 68 if (objs.length > 0) { 69 String name = ((ObjectName )objs[0]).toString(); 70 return name; 71 } else { 72 return null; 73 } 74 } 75 76 79 public String getWebModule(){ 80 return this.webModuleName; 81 } 82 83 86 public String getJ2EEApplication(){ 87 return this.applicationName; 88 } 89 90 } 91 | Popular Tags |