1 23 24 package com.sun.enterprise.admin.server.core.mbean.config; 25 26 import com.sun.enterprise.admin.common.exception.J2EEWebModuleException; 27 import com.sun.enterprise.admin.common.constant.AdminConstants; 28 import com.sun.enterprise.admin.common.ObjectNames; 29 import com.sun.enterprise.admin.server.core.mbean.config.naming.ConfigMBeanNamingInfo; 30 31 import com.sun.enterprise.config.ConfigException; 33 import com.sun.enterprise.config.serverbeans.ServerXPathHelper; 34 import com.sun.enterprise.config.serverbeans.J2eeApplication; 35 36 37 import com.sun.enterprise.admin.common.exception.MBeanConfigException; 39 40 51 public class ManagedJ2EEWebModule extends ConfigMBeanBase 52 { 53 private static final String [][] MAPLIST = null; 54 private static final String [] ATTRIBUTES = null; 55 private static final String [] OPERATIONS = 56 { 57 "getServlets(), INFO", 58 }; 59 60 61 64 public ManagedJ2EEWebModule() throws MBeanConfigException 65 { 66 this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS); 67 } 68 69 public ManagedJ2EEWebModule(String instanceName, String applicationName, String moduleName) 70 throws MBeanConfigException 71 { 72 this(); initialize(ObjectNames.kWebModule, new String []{instanceName, applicationName, moduleName}); 74 75 } 76 77 public String [] getServlets() throws J2EEWebModuleException 78 { 79 ConfigMBeanNamingInfo namingInfo = this.getConfigMBeanNamingInfo(); 80 String [] locParams = namingInfo.getLocationParams(); 81 String applicationName = locParams[1]; 82 String moduleName = locParams[2]; 83 84 try 85 { 86 J2eeApplication app = (J2eeApplication) this.getConfigBeanByXPath(ServerXPathHelper.getAppIdXpathExpression(applicationName)); 87 String location = app.getLocation(); 88 return ModulesXMLHelper.getServletsForWebModule(location, moduleName); 89 } 90 catch (Exception e) 91 { 92 sLogger.throwing(getClass().getName(), "getServlets", e); 93 throw new J2EEWebModuleException(e.getMessage()); 94 } 95 } 96 97 public String [] getJSPPages() throws J2EEWebModuleException 98 { 99 return ( null ); 100 } 101 102 103 public int getModuleType() 104 { 105 return ( AdminConstants.kTypeWebModule ); 106 } 107 } 109 | Popular Tags |