1 25 26 package org.objectweb.jonas_ejb.deployment.api; 27 28 import java.security.PermissionCollection ; 29 import java.security.Permissions ; 30 import java.util.List ; 31 import java.util.Iterator ; 32 import javax.security.jacc.EJBMethodPermission ; 33 34 import org.objectweb.jonas_ejb.deployment.xml.Method; 35 import org.objectweb.jonas_ejb.deployment.xml.MethodParams; 36 37 42 public class CommonMethodDesc { 43 44 47 private PermissionCollection ejbMethodPermissions = null; 48 49 50 54 public CommonMethodDesc(List list) { 55 this.ejbMethodPermissions = new Permissions (); 56 generateEJBMethodPermissions(list); 57 } 58 59 60 64 protected void generateEJBMethodPermissions(List methodList) { 65 Iterator it = methodList.iterator(); 66 67 while (it.hasNext()) { 69 Method method = (Method) it.next(); 70 MethodParams methodParams = method.getMethodParams(); 71 String [] methodParamsArray = null; 72 if (methodParams != null) { 73 74 List methodParamsList = method.getMethodParams().getMethodParamList(); 75 String [] methodParamSize = new String [methodParamsList.size()]; 76 methodParamsArray = (String []) methodParamsList.toArray(methodParamSize); 77 } 78 79 String methodName = method.getMethodName(); 81 if (methodName.equals("*")) { 82 methodName = null; 83 } 84 85 86 EJBMethodPermission ejbMethodPermission = 87 new EJBMethodPermission (method.getEjbName(), 88 methodName, 89 method.getMethodIntf(), 90 methodParamsArray); 91 ejbMethodPermissions.add(ejbMethodPermission); 93 } 94 } 95 96 100 public PermissionCollection getEJBMethodPermissions() { 101 return ejbMethodPermissions; 102 } 103 } 104 | Popular Tags |