Package org.springframework.core

Examples of org.springframework.core.OrderComparator


      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, HandlerAdapter.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.handlerAdapters = new ArrayList(matchingBeans.values());
        // We keep HandlerAdapters in sorted order.
        Collections.sort(this.handlerAdapters, new OrderComparator());
      }
    }
    else {
      try {
        Object ha = context.getBean(HANDLER_ADAPTER_BEAN_NAME, HandlerAdapter.class);
View Full Code Here


      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, HandlerExceptionResolver.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.handlerExceptionResolvers = new ArrayList(matchingBeans.values());
        // We keep HandlerExceptionResolvers in sorted order.
        Collections.sort(this.handlerExceptionResolvers, new OrderComparator());
      }
    }
    else {
      try {
        Object her = context.getBean(
View Full Code Here

      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, ViewResolver.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.viewResolvers = new ArrayList(matchingBeans.values());
        // We keep ViewResolvers in sorted order.
        Collections.sort(this.viewResolvers, new OrderComparator());
      }
    }
    else {
      try {
        Object vr = context.getBean(VIEW_RESOLVER_BEAN_NAME, ViewResolver.class);
View Full Code Here

    if (logger.isDebugEnabled()) {
      logger.debug("Looking for exception mappings: " + getApplicationContext());
    }

    List<ControllerAdviceBean> beans = ControllerAdviceBean.findAnnotatedBeans(getApplicationContext());
    Collections.sort(beans, new OrderComparator());

    for (ControllerAdviceBean bean : beans) {
      ExceptionHandlerMethodResolver resolver = new ExceptionHandlerMethodResolver(bean.getBeanType());
      if (resolver.hasExceptionMappings()) {
        this.exceptionHandlerAdviceCache.put(bean, resolver);
View Full Code Here

        nonOrderedPostProcessorNames.add(postProcessorNames[i]);
      }
    }

    // First, invoke the BeanFactoryPostProcessors that implement PriorityOrdered.
    Collections.sort(priorityOrderedPostProcessors, new OrderComparator());
    invokeBeanFactoryPostProcessors(beanFactory, priorityOrderedPostProcessors);

    // Next, invoke the BeanFactoryPostProcessors that implement Ordered.
    List orderedPostProcessors = new ArrayList();
    for (Iterator it = orderedPostProcessorNames.iterator(); it.hasNext();) {
      String postProcessorName = (String) it.next();
      orderedPostProcessors.add(getBean(postProcessorName));
    }
    Collections.sort(orderedPostProcessors, new OrderComparator());
    invokeBeanFactoryPostProcessors(beanFactory, orderedPostProcessors);

    // Finally, invoke all other BeanFactoryPostProcessors.
    List nonOrderedPostProcessors = new ArrayList();
    for (Iterator it = nonOrderedPostProcessorNames.iterator(); it.hasNext();) {
View Full Code Here

        nonOrderedPostProcessorNames.add(postProcessorNames[i]);
      }
    }

    // First, invoke the BeanPostProcessors that implement PriorityOrdered.
    Collections.sort(priorityOrderedPostProcessors, new OrderComparator());
    registerBeanPostProcessors(beanFactory, priorityOrderedPostProcessors);

    // Next, invoke the BeanPostProcessors that implement Ordered.
    List orderedPostProcessors = new ArrayList();
    for (Iterator it = orderedPostProcessorNames.iterator(); it.hasNext();) {
      String postProcessorName = (String) it.next();
      orderedPostProcessors.add(getBean(postProcessorName));
    }
    Collections.sort(orderedPostProcessors, new OrderComparator());
    registerBeanPostProcessors(beanFactory, orderedPostProcessors);

    // Finally, invoke all other BeanPostProcessors.
    List nonOrderedPostProcessors = new ArrayList();
    for (Iterator it = nonOrderedPostProcessorNames.iterator(); it.hasNext();) {
View Full Code Here

      String name = globalInterceptorNames[i];
      Object bean = beanFactory.getBean(name);
      beans.add(bean);
      names.put(bean, name);
    }
    Collections.sort(beans, new OrderComparator());
    for (Iterator it = beans.iterator(); it.hasNext();) {
      Object bean = it.next();
      String name = (String) names.get(bean);
      if (name.startsWith(prefix)) {
        addAdvisorOnChainCreation(bean, name);
View Full Code Here

      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, HandlerMapping.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.handlerMappings = new ArrayList(matchingBeans.values());
        // We keep HandlerMappings in sorted order.
        Collections.sort(this.handlerMappings, new OrderComparator());
      }
    }
    else {
      try {
        Object hm = context.getBean(HANDLER_MAPPING_BEAN_NAME, HandlerMapping.class);
View Full Code Here

      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, HandlerAdapter.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.handlerAdapters = new ArrayList(matchingBeans.values());
        // We keep HandlerAdapters in sorted order.
        Collections.sort(this.handlerAdapters, new OrderComparator());
      }
    }
    else {
      try {
        Object ha = context.getBean(HANDLER_ADAPTER_BEAN_NAME, HandlerAdapter.class);
View Full Code Here

      Map matchingBeans = BeanFactoryUtils.beansOfTypeIncludingAncestors(
          context, HandlerExceptionResolver.class, true, false);
      if (!matchingBeans.isEmpty()) {
        this.handlerExceptionResolvers = new ArrayList(matchingBeans.values());
        // We keep HandlerExceptionResolvers in sorted order.
        Collections.sort(this.handlerExceptionResolvers, new OrderComparator());
      }
    }
    else {
      try {
        Object her = context.getBean(
View Full Code Here

TOP

Related Classes of org.springframework.core.OrderComparator

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.