Package com.sun.enterprise.deployment.annotation

Examples of com.sun.enterprise.deployment.annotation.AnnotationProcessor


            SarScanner scanner = new SarScanner();
            scanner.initScanRepository(new File(sarScanDir),
                  (WebBundleDescriptor) sbd, classLoader);

            if (!scanner.getElements().isEmpty()) {
                AnnotationProcessor ap = SipHandlerFactory.getAnnotationProcessor();
                ProcessingContext ctx = ap.createContext();

                ctx.setProcessingInput(scanner);
                ctx.pushHandler(aeHandler);
                ap.process(ctx);
                postProcessAnnotations();
            }
        } catch (DeploymentException e) {
            throw e;
        }
View Full Code Here


            SarScanner scanner = new SarScanner();
            scanner.initScanRepository(destForArchive,
                  (WebBundleDescriptor) dummySbd, getClassLoader());

            if (!scanner.getElements().isEmpty()) {
                AnnotationProcessor ap = SipHandlerFactory.getAnnotationProcessor();
                ProcessingContext ctx = ap.createContext();

                ctx.setProcessingInput(scanner);
                ctx.pushHandler(aeHandler);
                ap.process(ctx);
               
                // Check if there are Servlets or Listeners. XXX: Should the check for Servlets alone be not
                // enough?
                if ((!dummySbd.getSipApplication().getAnnotatedServlets().isEmpty()) ||
                   (!dummySbd.getSipApplication().getAnnotatedListeners().isEmpty())){
View Full Code Here

                    localStrings.getLocalString(
                    "enterprise.deployment.oldDDwithAnnotation",
                    "{0} in archive {1} is of version {2}, which cannot support annotations in an application.  Please upgrade the deployment descriptor to be a version supported by Java EE 5.0 (or later).",
                    new Object[] {ddName, archiveName, bundleDesc.getSpecVersion()}));
            }
            AnnotationProcessor ap = SJSASFactory.getAnnotationProcessor();
            ProcessingContext ctx = ap.createContext();
            if (annotationErrorHandler != null) {
                ctx.setErrorHandler(annotationErrorHandler);
            }
            ctx.setProcessingInput(scanner);
            ctx.pushHandler(aeHandler);
           
            // Make sure there is a classloader available on the descriptor
            // during annotation processing.
            ClassLoader originalBundleClassLoader = null;
            try {
                originalBundleClassLoader = bundleDesc.getClassLoader();
            } catch(Exception e) {
                // getClassLoader can throw exception if not available
            }
           
            // Only set classloader if it's not already set.
            if( originalBundleClassLoader == null ) {
                bundleDesc.setClassLoader(classLoader);
            }
           
            try {
                return ap.process(ctx);
            } finally {
                if( originalBundleClassLoader == null ) {
                    bundleDesc.setClassLoader(null);
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.annotation.AnnotationProcessor

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.