Examples of AnnotationProcessor


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

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

            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

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

                    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

Examples of com.sun.mirror.apt.AnnotationProcessor

     *         otherwise, returns the NO_OP annotation processor.
     */
    public AnnotationProcessor getProcessorFor(
            Set<AnnotationTypeDeclaration> declarations,
            AnnotationProcessorEnvironment env) {
        AnnotationProcessor result;
        if (declarations.isEmpty()) {
            result = AnnotationProcessors.NO_OP;
        } else {
            result = new TagAnnotationProcessor(env);
        }
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessor

      return Collections.singletonList("org.jboss.portal.unit.annotations.TestCase");
   }

   public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> annotationTypeDeclarations, AnnotationProcessorEnvironment annotationProcessorEnvironment)
   {
      AnnotationProcessor result;
      if(annotationTypeDeclarations.isEmpty()) {
         result = AnnotationProcessors.NO_OP;
      }
      else {
         // Next Step - implement this class:
View Full Code Here

Examples of com.sun.mirror.apt.AnnotationProcessor

    public Collection<String> supportedAnnotationTypes() {
        return Collections.singletonList("org.glassfish.enterprise.ha.store.annotations.StoreEntry");
    }

    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> decls, AnnotationProcessorEnvironment annEnv) {
        AnnotationProcessor ap = null;
        if (decls.isEmpty()) {
            ap = AnnotationProcessors.NO_OP;
        } else {
            ap = new StoreEntryAnnotationProcessor(decls, annEnv);
        }
View Full Code Here

Examples of org.apache.AnnotationProcessor

                    final Servlet servlet;
                   
                    try {
                        servletClass = ctxt.load();
                        servlet = (Servlet) servletClass.newInstance();
                        AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
                        if (annotationProcessor != null) {
                           annotationProcessor.processAnnotations(servlet);
                           annotationProcessor.postConstruct(servlet);
                        }
                    } catch (IllegalAccessException e) {
                        throw new JasperException(e);
                    } catch (InstantiationException e) {
                        throw new JasperException(e);
View Full Code Here

Examples of org.apache.AnnotationProcessor

    }

    public void destroy() {
        if (theServlet != null) {
            theServlet.destroy();
            AnnotationProcessor annotationProcessor = (AnnotationProcessor) config.getServletContext().getAttribute(AnnotationProcessor.class.getName());
            if (annotationProcessor != null) {
                try {
                    annotationProcessor.preDestroy(theServlet);
                } catch (Exception e) {
                    // Log any exception, since it can't be passed along
                    log.error(Localizer.getMessage("jsp.error.file.not.found",
                           e.getMessage()), e);
                }
View Full Code Here

Examples of org.apache.AnnotationProcessor

                    ClassLoader loader = context.getLoader().getClassLoader();
                    Object listener = event.getData();
                   
                    if(listener.getClass().getName().equals("org.apache.webbeans.servlet.WebBeansConfigurationListener"))
                    {  
                        AnnotationProcessor processor = context.getAnnotationProcessor();
                        AnnotationProcessor custom = new TomcatAnnotProcessor(context.getLoader().getClassLoader(),processor);
                        context.setAnnotationProcessor(custom);
                       
                        context.getServletContext().setAttribute(AnnotationProcessor.class.getName(), custom);
                       
                        ContextAccessController.setReadOnly(context.getNamingContextListener().getName());
View Full Code Here

Examples of org.apache.AnnotationProcessor

                        filterClass));
        }
        this.filter = (Filter) clazz.newInstance();
        if (!context.getIgnoreAnnotations()) {
            if (context instanceof StandardContext) {
               AnnotationProcessor processor = ((StandardContext)context).getAnnotationProcessor();
               processor.processAnnotations(this.filter);
               processor.postConstruct(this.filter);
            }
        }
        if (context instanceof StandardContext &&
            ((StandardContext) context).getSwallowOutput()) {
            try {
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.