Set set = wmd.getWebComponentDescriptorsSet();
StandardWrapper wrapper;
WebComponentDescriptor webComponentDesc;
Enumeration enumeration;
SecurityRoleReference securityRoleReference;
Set set2;
Iterator iterator2;
if ( !set.isEmpty() ){
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
webComponentDesc = (WebComponentDescriptor)iterator.next();
wrapper = (StandardWrapper)webModule.createWrapper();
wrapper.setName(webComponentDesc.getCanonicalName());
webModule.addChild(wrapper);
enumeration = webComponentDesc.getInitializationParameters();
InitializationParameter initP = null;
while (enumeration.hasMoreElements()){
initP = (InitializationParameter)enumeration.nextElement();
wrapper.addInitParameter(initP.getName(), initP.getValue());
}
if (webComponentDesc.isServlet()){
wrapper.setServletClass(
webComponentDesc.getWebComponentImplementation());
} else {
wrapper.setJspFile(webComponentDesc.
getWebComponentImplementation());
}
wrapper.setLoadOnStartup(webComponentDesc.getLoadOnStartUp());
if (webComponentDesc.getRunAsIdentity() != null)
wrapper.setRunAs(webComponentDesc.getRunAsIdentity().getRoleName());
set2 = webComponentDesc.getUrlPatternsSet();
iterator2 = set2.iterator();
while (iterator2.hasNext()){
webModule.addServletMapping((String)iterator2.next(),
webComponentDesc.getCanonicalName());
}
enumeration = webComponentDesc.getSecurityRoleReferences();
while (enumeration.hasMoreElements()){
securityRoleReference =
(SecurityRoleReference)enumeration.nextElement();
wrapper.
addSecurityReference(securityRoleReference.getRolename(),
securityRoleReference.getSecurityRoleLink().getName());
}
}
}
webModule.setSessionTimeout(wmd.getSessionTimeout());