Package javax.servlet.annotation

Examples of javax.servlet.annotation.HandlesTypes


         new HashMap<ServletContainerInitializer, Set<Class<?>>>();
      for (ServletContainerInitializer service : scis)
      {
         if (service.getClass().isAnnotationPresent(HandlesTypes.class))
         {
            HandlesTypes handlesTypesAnnotation = service.getClass().getAnnotation(HandlesTypes.class);
            Class<?>[] typesArray = handlesTypesAnnotation.value();
            if (typesArray != null)
            {
               for (Class<?> type : typesArray)
               {
                  Set<ServletContainerInitializer> servicesSet = typesMap.get(type);
View Full Code Here


        }

        for (ServletContainerInitializer sci : detectedScis) {
            initializerClassMap.put(sci, new HashSet<Class<?>>());

            HandlesTypes ht;
            try {
                ht = sci.getClass().getAnnotation(HandlesTypes.class);
            } catch (Exception e) {
                if (log.isDebugEnabled()) {
                    log.info(sm.getString("contextConfig.sci.debug",
                            sci.getClass().getName()),
                            e);
                } else {
                    log.info(sm.getString("contextConfig.sci.info",
                            sci.getClass().getName()));
                }
                continue;
            }
            if (ht == null) {
                continue;
            }
            Class<?>[] types = ht.value();
            if (types == null) {
                continue;
            }

            for (Class<?> type : types) {
View Full Code Here

                continue;
            }

            initializerClassMap.put(sci, new HashSet<Class<?>>());
           
            HandlesTypes ht =
                sci.getClass().getAnnotation(HandlesTypes.class);
            if (ht != null) {
                Class<?>[] types = ht.value();
                if (types != null) {
                    for (Class<?> type : types) {
                        Set<ServletContainerInitializer> scis =
                            typeInitializerMap.get(type);
                        if (scis == null) {
View Full Code Here

            if (servletContainerInitializerClassName != null) {
                try {
                    servletContainerInitializerClass = context.getLoader().getClassLoader()
                        .loadClass(servletContainerInitializerClassName);
                    if (servletContainerInitializerClass.isAnnotationPresent(HandlesTypes.class)) {
                        HandlesTypes handlesTypes = servletContainerInitializerClass.getAnnotation(HandlesTypes.class);
                        typesArray = handlesTypes.value();
                    }
                } catch (Throwable t) {
                    log.warn(sm.getString("contextConfig.servletContainerInitializer", file.getName()), t);
                    return;
                }
            }
            // Add in jarService map, and add in the local map used to speed up lookups
            ServletContainerInitializerInfo jarServletContainerInitializerService =
                new ServletContainerInitializerInfo(servletContainerInitializerClass, handlesTypesArray);
            servletContainerInitializerInfos.put(file.getName(), jarServletContainerInitializerService);
            if (typesArray != null) {
                ArrayList<Class<?>> handlesTypesList = new ArrayList<Class<?>>();
                if (handlesTypesArray != null) {
                    for (int i = 0; i < handlesTypesArray.length; i++) {
                        handlesTypesList.add(handlesTypesArray[i]);
                    }
                }
                for (int i = 0; i < typesArray.length; i++) {
                    handlesTypesList.add(typesArray[i]);
                    handlesTypes.put(typesArray[i], jarServletContainerInitializerService);
                }
                handlesTypesArray = handlesTypesList.toArray(handlesTypesArray);
            }
        }
    }
View Full Code Here

        }
        // Process HandlesTypes for ServletContainerInitializer
        Map<Class<?>, Set<ServletContainerInitializer>> typesMap = new HashMap<Class<?>, Set<ServletContainerInitializer>>();
        for (ServletContainerInitializer service : scis) {
            if (service.getClass().isAnnotationPresent(HandlesTypes.class)) {
                HandlesTypes handlesTypesAnnotation = service.getClass().getAnnotation(HandlesTypes.class);
                Class<?>[] typesArray = handlesTypesAnnotation.value();
                if (typesArray != null) {
                    for (Class<?> type : typesArray) {
                        Set<ServletContainerInitializer> servicesSet = typesMap.get(type);
                        if (servicesSet == null) {
                            servicesSet = new HashSet<ServletContainerInitializer>();
View Full Code Here

        }

        for (ServletContainerInitializer sci : detectedScis) {
            initializerClassMap.put(sci, new HashSet<Class<?>>());

            HandlesTypes ht;
            try {
                ht = sci.getClass().getAnnotation(HandlesTypes.class);
            } catch (Exception e) {
                if (log.isDebugEnabled()) {
                    log.info(sm.getString("contextConfig.sci.debug",
                            sci.getClass().getName()),
                            e);
                } else {
                    log.info(sm.getString("contextConfig.sci.info",
                            sci.getClass().getName()));
                }
                continue;
            }
            if (ht == null) {
                continue;
            }
            Class<?>[] types = ht.value();
            if (types == null) {
                continue;
            }

            for (Class<?> type : types) {
View Full Code Here

                }
                if (!ServletContainerInitializer.class.isAssignableFrom(servletContainerInitializerClass)) {
                    logger.warn("Class " + servletContainerInitializer + " does not implement ServletContainerInitializer interface, ignored");
                    continue;
                }
                HandlesTypes handlesTypes = servletContainerInitializerClass.getAnnotation(HandlesTypes.class);
                if (handlesTypes == null || handlesTypes.value().length == 0) {
                    servletContainerInitializerClassNamesMap.put(servletContainerInitializer, null);
                    continue;
                }
                BundleClassFinder bundleClassFinder = new BundleAssignableClassFinder(packageAdmin, bundle, handlesTypes.value(), new ClassDiscoveryFilter() {

                    @Override
                    public boolean directoryDiscoveryRequired(String directory) {
                        return true;
                    }
View Full Code Here

        }

        for (ServletContainerInitializer sci : detectedScis) {
            initializerClassMap.put(sci, new HashSet<Class<?>>());

            HandlesTypes ht;
            try {
                ht = sci.getClass().getAnnotation(HandlesTypes.class);
            } catch (Exception e) {
                if (log.isDebugEnabled()) {
                    log.info(sm.getString("contextConfig.sci.debug",
                            sci.getClass().getName()),
                            e);
                } else {
                    log.info(sm.getString("contextConfig.sci.info",
                            sci.getClass().getName()));
                }
                continue;
            }
            if (ht == null) {
                continue;
            }
            Class<?>[] types = ht.value();
            if (types == null) {
                continue;
            }

            for (Class<?> type : types) {
View Full Code Here

                continue;
            }

            initializerClassMap.put(sci, new HashSet<Class<?>>());

            HandlesTypes ht = null;
            try {
                ht = sci.getClass().getAnnotation(HandlesTypes.class);
            } catch (Exception e) {
                if (log.isDebugEnabled()) {
                    log.info(sm.getString("contextConfig.sci.debug", url), e);
                } else {
                    log.info(sm.getString("contextConfig.sci.info", url));
                }
            }
            if (ht != null) {
                Class<?>[] types = ht.value();
                if (types != null) {
                    for (Class<?> type : types) {
                        if (type.isAnnotation()) {
                            handlesTypesAnnotations = true;
                        } else {
View Full Code Here

        }
        // Process HandlesTypes for ServletContainerInitializer
        Map<Class<?>, Set<ServletContainerInitializer>> typesMap = new HashMap<Class<?>, Set<ServletContainerInitializer>>();
        for (ServletContainerInitializer service : scis) {
            if (service.getClass().isAnnotationPresent(HandlesTypes.class)) {
                HandlesTypes handlesTypesAnnotation = service.getClass().getAnnotation(HandlesTypes.class);
                Class<?>[] typesArray = handlesTypesAnnotation.value();
                if (typesArray != null) {
                    for (Class<?> type : typesArray) {
                        Set<ServletContainerInitializer> servicesSet = typesMap.get(type);
                        if (servicesSet == null) {
                            servicesSet = new HashSet<ServletContainerInitializer>();
View Full Code Here

TOP

Related Classes of javax.servlet.annotation.HandlesTypes

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.