Package org.jboss.jandex

Examples of org.jboss.jandex.MethodInfo.args()


            AnnotationTarget target = annotationInstance.target();
            if (target instanceof ClassInfo) {
                componentDescription.addAsynchronousView(ClassInfo.class.cast(target).name().toString());
            } else if (target instanceof MethodInfo) {
                final MethodInfo methodInfo = MethodInfo.class.cast(target);
                final String[] args = new String[methodInfo.args().length];
                for(int i = 0; i < methodInfo.args().length; i++) {
                    args[i] = methodInfo.args()[i].name().toString();
                }
                componentDescription.addAsynchronousMethod(MethodIdentifier.getIdentifier(methodInfo.returnType().name().toString(), methodInfo.name(), args));
            }
View Full Code Here


            if (target instanceof ClassInfo) {
                componentDescription.addAsynchronousView(ClassInfo.class.cast(target).name().toString());
            } else if (target instanceof MethodInfo) {
                final MethodInfo methodInfo = MethodInfo.class.cast(target);
                final String[] args = new String[methodInfo.args().length];
                for(int i = 0; i < methodInfo.args().length; i++) {
                    args[i] = methodInfo.args()[i].name().toString();
                }
                componentDescription.addAsynchronousMethod(MethodIdentifier.getIdentifier(methodInfo.returnType().name().toString(), methodInfo.name(), args));
            }
        }
View Full Code Here

                componentDescription.addAsynchronousView(ClassInfo.class.cast(target).name().toString());
            } else if (target instanceof MethodInfo) {
                final MethodInfo methodInfo = MethodInfo.class.cast(target);
                final String[] args = new String[methodInfo.args().length];
                for(int i = 0; i < methodInfo.args().length; i++) {
                    args[i] = methodInfo.args()[i].name().toString();
                }
                componentDescription.addAsynchronousMethod(MethodIdentifier.getIdentifier(methodInfo.returnType().name().toString(), methodInfo.name(), args));
            }
        }
    }
View Full Code Here

                componentDescription.setBeanLevelAccessTimeout(((ClassInfo) target).name().toString(), accessTimeout);
                logger.debug("Bean " + componentDescription.getEJBName() + " marked for access timeout: " + accessTimeout);
            } else if (target instanceof MethodInfo) {
                // method specific access timeout
                final MethodInfo methodInfo = (MethodInfo) target;
                final String[] argTypes = new String[methodInfo.args().length];
                int i = 0;
                for (Type argType : methodInfo.args()) {
                    argTypes[i++] = argType.name().toString();
                }
                MethodIdentifier identifier = MethodIdentifier.getIdentifier(methodInfo.returnType().name().toString(), methodInfo.name(), argTypes);
View Full Code Here

            } else if (target instanceof MethodInfo) {
                // method specific access timeout
                final MethodInfo methodInfo = (MethodInfo) target;
                final String[] argTypes = new String[methodInfo.args().length];
                int i = 0;
                for (Type argType : methodInfo.args()) {
                    argTypes[i++] = argType.name().toString();
                }
                MethodIdentifier identifier = MethodIdentifier.getIdentifier(methodInfo.returnType().name().toString(), methodInfo.name(), argTypes);
                componentDescription.setAccessTimeout(accessTimeout, identifier);
            }
View Full Code Here

        }
        final MethodInfo methodInfo = MethodInfo.class.cast(target);
        final ClassInfo classInfo = methodInfo.declaringClass();
        final EEModuleClassDescription classDescription = eeModuleDescription.getOrAddClassByName(classInfo.name().toString());

        final Type[] args = methodInfo.args();
        if (args.length > 1) {
            log.warn("Invalid number of arguments for method " + methodInfo.name() + " annotated with " + annotationType + " on class " + classInfo.name());
            return;
        } else if (args.length == 1 && !args[0].name().toString().equals(InvocationContext.class.getName())) {
            log.warn("Invalid signature for method " + methodInfo.name() + " annotated with " + annotationType + " on class " + classInfo.name() + ", signature must be void methodName(InvocationContext ctx)");
View Full Code Here

        ArrayList<Annotation> annotations = new ArrayList<Annotation>(annotationTargets.size());
        for (AnnotationTarget target : annotationTargets) {
            Annotation annotation = null;
            if (target instanceof MethodInfo) {
                MethodInfo m = (MethodInfo) target;
                List<String> parameterTypes = new ArrayList<String>(m.args().length);
                for (Type type : m.args()) {
                    parameterTypes.add(type.toString());
                }
                String declaringClass = m.declaringClass().name().toString();
                annotation = new AnnotationImpl(declaringClass, cl, parameterTypes, m.name(), true, false, annotationClass);
View Full Code Here

        for (AnnotationTarget target : annotationTargets) {
            Annotation annotation = null;
            if (target instanceof MethodInfo) {
                MethodInfo m = (MethodInfo) target;
                List<String> parameterTypes = new ArrayList<String>(m.args().length);
                for (Type type : m.args()) {
                    parameterTypes.add(type.toString());
                }
                String declaringClass = m.declaringClass().name().toString();
                annotation = new AnnotationImpl(declaringClass, cl, parameterTypes, m.name(), true, false, annotationClass);
            }
View Full Code Here

            if (!(target instanceof MethodInfo)) {
                throw new DeploymentUnitProcessingException(annotationType + " is only valid on method targets.");
            }

            final MethodInfo methodInfo = MethodInfo.class.cast(target);
            final Type[] args = methodInfo.args();
            try {
                switch (args.length) {
                    case 0:
                        if(requireInvocationContext) {
                            throw new DeploymentUnitProcessingException("Missing argument.  Methods annotated with " + annotationType + " must have either single InvocationContext argument.");
View Full Code Here

        if (!(target instanceof MethodInfo)) {
            throw new IllegalArgumentException(annotationType + " is only valid on method targets.");
        }

        final MethodInfo methodInfo = MethodInfo.class.cast(target);
        final Type[] args = methodInfo.args();
        if (declaredOnTargetClass) {
            if (args.length == 0) {
                return InterceptorMethodDescription.create(classInfo.name().toString(), actualClass, methodInfo, declaredOnTargetClass);
            } else {
                throw new IllegalArgumentException("Invalid number of arguments for method " + methodInfo.name() + " annotated with " + annotationType + " on class " + classInfo.name());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.