Package org.glassfish.apf

Examples of org.glassfish.apf.AnnotationProcessorException


     */
    private void setAsynchronous(Method m0, EjbDescriptor ejbDesc, String methodIntf)
            throws AnnotationProcessorException {

        if( !ejbDesc.getType().equals(EjbSessionDescriptor.TYPE)) {
            throw new AnnotationProcessorException("Invalid asynchronous method " + m0 +
                 "@Asynchronous is only permitted for session beans");
        }


        EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc;
View Full Code Here


            // name() and beanInterface() are required for TYPE-level @EJB
            // if either of them not set, fail fast.  See issue 17284
            if (ejbAn.name().equals("") ||
                    ejbAn.beanInterface() == Object.class ) {
                Class c = (Class) ainfo.getAnnotatedElement();
                AnnotationProcessorException fatalException =
                    new AnnotationProcessorException(localStrings.getLocalString(
                    "enterprise.deployment.annotation.handlers.invalidtypelevelejb",
                    "Invalid TYPE-level @EJB with name() = [{0}] and " +
                    "beanInterface = [{1}] in {2}.  Each TYPE-level @EJB " +
                    "must specify both name() and beanInterface().",
                    new Object[] { ejbAn.name(), ejbAn.beanInterface(), c }),
                    ainfo);
                fatalException.setFatal(true);
                throw fatalException;
            }
        } else {
            // can't happen
            return getDefaultFailedResult();
View Full Code Here

                        break;
                    case BEAN :
                        descCMType = EjbSessionDescriptor.ConcurrencyManagementType.Bean;
                        break;
                    default :
                        throw new AnnotationProcessorException("Unsupported concurrency management " +
                                "type = " + cmType);

                }

                EjbSessionDescriptor sDesc = (EjbSessionDescriptor) ejbDesc;
View Full Code Here

     * Verify that the return type is void and it's a no-arg method
     */
    private void checkValid(Method m) throws AnnotationProcessorException {
        if ( !(m.getReturnType().equals(Void.TYPE) &&
                m.getParameterTypes().length == 0) ) {
            throw new AnnotationProcessorException("Method " + m +
                    "annotated as @BeforeCompletion is not valid");
        }
    }
View Full Code Here

     * Verify that the return type is void and it's a no-arg method
     */
    private void checkValid(Method m) throws AnnotationProcessorException {
        if ( !(m.getReturnType().equals(Void.TYPE) &&
                m.getParameterTypes().length == 0) ) {
            throw new AnnotationProcessorException("Method " + m +
                    "annotated as @AfterBegin is not valid");
        }
    }
View Full Code Here

        ComponentInfo info = null;
        try {
            info = scanner.getComponentInfo(c);
        } catch (NoClassDefFoundError err) {
            // issue 456: allow verifier to report this issue
            AnnotationProcessorException ape =
                    new AnnotationProcessorException(
                            AnnotationUtils.getLocalString(
                                    "enterprise.deployment.annotation.classnotfounderror",
                                    "Class [ {0} ] not found. Error while loading [ {1} ]",
                                    new Object[]{err.getMessage(), c}));
            ctx.getErrorHandler().error(ape);
View Full Code Here

                    if (ape.isFatal()) {
                        throw ape;
                    }
                   
                    if (++errorCount>100){
                        throw new AnnotationProcessorException(
                                AnnotationUtils.getLocalString(
                                    "enterprise.deployment.annotation.toomanyerror",
                                    "Too many errors, annotation processing abandoned."));
                    }
                   
                    processingResult =
                        HandlerProcessingResultImpl.getDefaultResult(
                        annotation.annotationType(), ResultType.FAILED);
                } catch(Throwable e){
                    AnnotationProcessorException ape = new AnnotationProcessorException(e.getMessage(), element);
                    ape.initCause(e);
                    throw ape;
                }
                result.addAll(processingResult);
            }
        } else {
            if (delegate!=null) {
                delegate.process(ctx, element, result);
            } else {          
                ctx.getErrorHandler().fine(
                        new AnnotationProcessorException("No handler defined for "
                            + annotation.annotationType()));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.apf.AnnotationProcessorException

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.