}
((WebBundleDescriptor)webBundleDescriptor).addEnvironmentProperty(envEntry);
}
ContextResource[] resources = context.findResources();
ResourceReferenceDescriptor resourceReference;
SunWebApp iasBean =
((WebBundleDescriptor)webBundleDescriptor).getSunDescriptor();
ResourceRef[] rr = iasBean.getResourceRef();
DefaultResourcePrincipal drp;
ResourcePrincipal rp;
for (int i=0; i<resources.length; i++) {
resourceReference = new ResourceReferenceDescriptor(
resources[i].getName(), resources[i].getDescription(),
resources[i].getType());
resourceReference.setJndiName(resources[i].getName());
if (rr!=null) {
for (int j=0; j<rr.length; j++) {
if (resources[i].getName().equals(rr[j].getResRefName())) {
resourceReference.setJndiName(rr[i].getJndiName());
drp = rr[i].getDefaultResourcePrincipal();
if (drp!=null) {
rp = new ResourcePrincipal(drp.getName(), drp.getPassword());
resourceReference.setResourcePrincipal(rp);
}
}
}
}
resourceReference.setAuthorization(resources[i].getAuth());
((WebBundleDescriptor)webBundleDescriptor).addResourceReference(resourceReference);
}
Switch sw = Switch.getSwitch();
sw.getNamingManager().bindObjects((WebBundleDescriptor)webBundleDescriptor);