Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.MethodDescriptor


                // postpone the processing at the end
                ejbContext.addPostProcessInfo(ainfo, this);
            } else { // METHOD
                Method annMethod = (Method)ainfo.getAnnotatedElement();
                for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
                    MethodDescriptor md = (MethodDescriptor)next;
                    Method m = md.getMethod(ejbDesc);
                    if (TypeUtil.sameMethodSignature(m, annMethod)) {
                        // override by xml
                        if (!hasMethodPermissionsFromDD(md, ejbDesc)) {
                            ejbDesc.addPermissionedMethod(
                                MethodPermission.getUncheckedMethodPermission(),
View Full Code Here


                    MethodPermission.getUncheckedMethodPermission(), md);
            }
        } else {
            Class classAn = (Class)ainfo.getAnnotatedElement();
            for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
                MethodDescriptor md = (MethodDescriptor)next;
                if (classAn.equals(ejbContext.getDeclaringClass(md)) &&
                        !hasMethodPermissionsFromDD(md, ejbDesc)) {
                    ejbDesc.addPermissionedMethod(
                        MethodPermission.getUncheckedMethodPermission(),
                        md);
View Full Code Here

        // super-class and can be public, protected, private, or
        // package access.  There can be at most one timeout method for
        // the entire bean class hierarchy, so we start from the bean
        // class and go up, stopping when we find the first one.

        MethodDescriptor timeoutMethodDesc = null;
        Class nextClass = ejbClass;
        while((nextClass != Object.class) && (nextClass != null)
              && (timeoutMethodDesc == null) ) {
            Method[] methods = nextClass.getDeclaredMethods();
            for(Method m : methods) {
                if( (m.getAnnotation(Timeout.class) != null) ) {
                    timeoutMethodDesc =
                        new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
                    break;
                }
            }
            nextClass = nextClass.getSuperclass();
        }

        if( (timeoutMethodDesc == null) &&
            javax.ejb.TimedObject.class.isAssignableFrom(ejbClass) ) {
            // If the class implements the TimedObject interface, it must
            // be ejbTimeout.
            timeoutMethodDesc = new MethodDescriptor
                ("ejbTimeout", "@Timeout method",
                 new String[] { "javax.ejb.Timer" },
                 MethodDescriptor.EJB_BEAN);
        }
View Full Code Here

                ejbContext.addPostProcessInfo(ainfo, this);
            } else {
                Method annMethod = (Method) ainfo.getAnnotatedElement();
               
                for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
                    MethodDescriptor md = (MethodDescriptor)next;
                    Method m = md.getMethod(ejbDesc);
                    if (TypeUtil.sameMethodSignature(m, annMethod)) {
                        // override by xml
                        if (!hasMethodPermissionsFromDD(md, ejbDesc)) {
                            addMethodPermissions(rolesAllowedAn, ejbDesc, md);
                        }
View Full Code Here

                addMethodPermissions(rolesAllowedAn, ejbDesc, md);
            }
        } else {
            Class classAn = (Class)ainfo.getAnnotatedElement();
            for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
                MethodDescriptor md = (MethodDescriptor)next;
                Method m = md.getMethod(ejbDesc);
                // override by existing info
                if (classAn.equals(ejbContext.getDeclaringClass(md)) &&
                        !hasMethodPermissionsFromDD(md, ejbDesc)) {
                    addMethodPermissions(rolesAllowedAn, ejbDesc, md);
                }
View Full Code Here

            binding.setEjbName(ejbDescriptor.getName());
            binding.setExcludeClassInterceptors(true);

            // Annotation can only be defined at the method level.
            Method m = (Method) ainfo.getAnnotatedElement();
            MethodDescriptor md =
                new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
            binding.setBusinessMethod(md);

            ejbBundle.prependInterceptorBinding(binding);
        }
View Full Code Here

   
    public void startElement(XMLElement element, Attributes attributes) {

        if( EjbTagNames.METHOD.equals(element.getQName()) ) {

            businessMethod = new MethodDescriptor();
            // Assume we need overloaded method resolution until we
            // encounter at least one method-param element.
            needsOverloadResolution = true;

        } else if( EjbTagNames.METHOD_PARAMS.equals(element.getQName()) ) {
View Full Code Here

        for (EjbContext ejbContext : ejbContexts) {
            EjbDescriptor ejbDesc = ejbContext.getDescriptor();
               
            for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) {
                MethodDescriptor md = (MethodDescriptor)next;
                // override by xml
                if (!hasMethodPermissionsFromDD(md, ejbDesc)) {
                    Method m = md.getMethod(ejbDesc);
                    if (TypeUtil.sameMethodSignature(m, annMethod)) {
                        ejbDesc.addPermissionedMethod(
                            MethodPermission.getExcludedMethodPermission(), md);
                    }
                }
View Full Code Here

        for(InterceptorBindingDescriptor binding : interceptorBindings) {

            if( (binding.getEjbName().equals(ejbName)) &&
                (binding.getBindingType() == BindingType.METHOD) ) {

                MethodDescriptor method = binding.getBusinessMethod();

                List<InterceptorBindingDescriptor> methodBindingDescs =
                    methodBindings.get(method);
                if( methodBindingDescs == null ) {
                    methodBindingDescs =
View Full Code Here

        for(InterceptorBindingDescriptor next : origBindings) {

            if( next.getNeedsOverloadResolution() ) {

                MethodDescriptor overloadedMethodDesc =
                    next.getBusinessMethod();
                String methodName = overloadedMethodDesc.getName();
                // For method-specific interceptors, there must be an ejb-name.
                String ejbName = next.getEjbName();

                EjbDescriptor ejbDesc = bundleDesc.getEjbByName(ejbName);
                Class ejbClass = null;
          
                try {
                    ejbClass = cl.loadClass(ejbDesc.getEjbClassName());
                } catch(Exception e) {
                    RuntimeException re = new RuntimeException
                        ("Error loading ejb class "+ejbDesc.getEjbClassName());
                    re.initCause(e);
                    throw re;
                }

                for(Method ejbClassMethod : ejbClass.getDeclaredMethods()) {

                    if( ejbClassMethod.getName().equals(methodName) ) {

                        InterceptorBindingDescriptor newInterceptorBinding =
                            new InterceptorBindingDescriptor();

                        MethodDescriptor newMethodDesc = new MethodDescriptor
                            (ejbClassMethod, MethodDescriptor.EJB_BEAN);
                       
                        newInterceptorBinding.setEjbName(ejbName);
                        newInterceptorBinding.setBusinessMethod
                            (newMethodDesc);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.MethodDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.