FileDocCategorySizeDatePackage
MethodPermissionMethodExists.javaAPI DocGlassfish v2 API3961Fri May 04 22:33:36 BST 2007com.sun.enterprise.tools.verifier.tests.ejb.elements

MethodPermissionMethodExists

public class MethodPermissionMethodExists extends MethodsExist implements com.sun.enterprise.tools.verifier.tests.ejb.EjbCheck
Methods used in method permission element of the deployment descriptor must be methods defined in the enterprise bean's component and/or home interface.

Fields Summary
Constructors Summary
Methods Summary
public com.sun.enterprise.tools.verifier.Resultcheck(EjbDescriptor descriptor)
Methods used in method permission element of the deployment descriptor must be methods defined in the enterprise bean's remote and/or home interface.

param
descriptor the Enterprise Java Bean deployment descriptor
return
Result the results for this assertion


        result = getInitializedResult();
        compName = getVerifierContext().getComponentNameConstructor();

        if ((descriptor instanceof EjbSessionDescriptor)  ||
                (descriptor instanceof EjbEntityDescriptor)) {
            Map<MethodPermission,
                    Collection<MethodDescriptor>> permissionedMethods = descriptor.getMethodPermissionsFromDD();
        
            if (permissionedMethods!=null) {

                for (MethodPermission methodPermission : permissionedMethods.keySet()) 
                    for (MethodDescriptor methodDescriptor : permissionedMethods.get(methodPermission)) 
                        checkMethodStyles(methodDescriptor, descriptor);
            }
        }

        if(result.getStatus() != Result.FAILED) {
            addGoodDetails(result, compName);
            result.passed(smh.getLocalString
                    (getClass().getName() + ".passed",
                    "Valid method permission method(s) found."));
        }
        return result;