protected void generatePolicy() throws IASDeploymentException {
try{
// generate policy for all web modules with
// moduleName + contextRoot and then generate for ejbs
// with Appname
Application applicationDD = request.getDescriptor();
// link with the ejb name
String linkName = null;
boolean lastInService = false;
for (Iterator iter = applicationDD.getWebBundleDescriptors().iterator();
iter.hasNext();){
String name
= WebSecurityManager.getContextID((WebBundleDescriptor)iter.next());
lastInService = SecurityUtil.linkPolicyFile(name, linkName, lastInService);
linkName = name;
}
for (Iterator iter = applicationDD.getEjbBundleDescriptors().iterator(); iter.hasNext();) {
String name =
EJBSecurityManager.getContextID((EjbBundleDescriptor)iter.next());
lastInService = SecurityUtil.linkPolicyFile(name, linkName, lastInService);
linkName = name;
}
// generate policies
for (Iterator iter = applicationDD.getWebBundleDescriptors().iterator();
iter.hasNext();){
String name
= WebSecurityManager.getContextID((WebBundleDescriptor)iter.next());
SecurityUtil.generatePolicyFile(name);
}
for (Iterator iter = applicationDD.getEjbBundleDescriptors().iterator(); iter.hasNext();) {
String name =
EJBSecurityManager.getContextID((EjbBundleDescriptor)iter.next());
SecurityUtil.generatePolicyFile(name);
}
ModuleType mt = XModuleType.getModuleType("org.jvnet.glassfish.comms.deployment.backend.SipArchiveDeployer");
Set extDescSet = applicationDD.getBundleDescriptors(mt);
// Set extDescSet = applicationDD.getExtnBundleDescriptors();
Iterator sitr = extDescSet.iterator();
while (sitr.hasNext()) {
//BundleDescriptor bd = sitr.next();