throws ServerInstanceException {
String [] modComponents = new String[0];
if ((modName == null) || (modName.length() < 1)) {
throw new ServerInstanceException("invalid ModuleName");
}
try {
sLogger.log(Level.FINE,
"ApplicationsConfigMBean.getModuleComponents for application = " +
appName + " and module = " + modName);
// Get application descriptor
AppsManager am = InstanceFactory.createAppsManager(getInstanceName());
Application appD = null;
try {
appD = (Application) DeploymentUtils.getDescriptor(appName, am);
} catch (java.lang.NullPointerException npe) {
throw new ServerInstanceException(
localStrings.getString("admin.mbeans.ssmb.invalid_appname", appName));
}
// Get the bundle descriptor for the given module
// and determine its' type
BundleDescriptor bd = null;
ModuleType modType = null;
java.util.Set bds = appD.getBundleDescriptors();
for(Iterator it=bds.iterator(); it.hasNext(); ) {
bd = (BundleDescriptor)it.next();
if ((bd.getModuleDescriptor().getArchiveUri()).equals(modName) ||
bd.getModuleID().equals(modName) ||
bd.getName().equals(modName)) {
modType = bd.getModuleType();
break;
}
}
// invoke approprite module to list components
if (modType == ModuleType.EJB) {
modComponents = getValidatedObjectNames(
getEjbModuleComponents((EjbBundleDescriptor)bd));
return modComponents;
} else if (modType == ModuleType.WAR) {
modComponents = getValidatedObjectNames(
getWebModuleComponents((WebBundleDescriptor)bd));
return modComponents;
} else if (modType == ModuleType.RAR) {
modComponents = getValidatedObjectNames(
getRarModuleComponents((ConnectorDescriptor)bd));
return modComponents;
} else if (modType == ModuleType.CAR) {
modComponents = getValidatedObjectNames(
getCarModuleComponents(bd));
return modComponents;
} else {
throw new ServerInstanceException("invalid module or application name");
}
} catch (Exception e) {
sLogger.log(Level.WARNING, "ApplicationsConfigMBean.getModuleComponents failed", e);
throw new ServerInstanceException(e.getLocalizedMessage());
}
}