1 23 package com.sun.enterprise.tools.verifier.tests.ejb.elements; 24 25 import com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck; 26 import com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor; 27 import com.sun.enterprise.tools.verifier.Result; 28 import com.sun.enterprise.deployment.*; 29 30 import java.util.Collection ; 31 import java.util.Map ; 32 33 38 public class MethodPermissionMethodExists extends MethodsExist implements EjbCheck { 39 40 48 public Result check(EjbDescriptor descriptor) { 49 50 result = getInitializedResult(); 51 compName = getVerifierContext().getComponentNameConstructor(); 52 53 if ((descriptor instanceof EjbSessionDescriptor) || 54 (descriptor instanceof EjbEntityDescriptor)) { 55 Map <MethodPermission, 56 Collection <MethodDescriptor>> permissionedMethods = descriptor.getMethodPermissionsFromDD(); 57 58 if (permissionedMethods!=null) { 59 60 for (MethodPermission methodPermission : permissionedMethods.keySet()) 61 for (MethodDescriptor methodDescriptor : permissionedMethods.get(methodPermission)) 62 checkMethodStyles(methodDescriptor, descriptor); 63 } 64 } 65 66 if(result.getStatus() != Result.FAILED) { 67 addGoodDetails(result, compName); 68 result.passed(smh.getLocalString 69 (getClass().getName() + ".passed", 70 "Valid method permission method(s) found.")); 71 } 72 return result; 73 } 74 } 75 76 | Popular Tags |