Package org.springframework.core

Examples of org.springframework.core.OrderComparator$OrderSourceProvider


        requestCacheAwareFilter.getPropertyValues().addPropertyValue("requestCache", authBldr.getRequestCache());
        unorderedFilterChain.add(new OrderDecorator(requestCacheAwareFilter, REQUEST_CACHE_FILTER));

        unorderedFilterChain.addAll(buildCustomFilterList(element, pc));

        Collections.sort(unorderedFilterChain, new OrderComparator());
        checkFilterChainOrder(unorderedFilterChain, pc, source);

        List<BeanMetadataElement> filterChain = new ManagedList<BeanMetadataElement>();

        for (OrderDecorator od : unorderedFilterChain) {
View Full Code Here


    if (logger.isInfoEnabled()) {
      logger.info("Looking for @ControllerAdvice: " + getApplicationContext());
    }

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

    List<Object> responseBodyAdviceBeans = new ArrayList<Object>();

    for (ControllerAdviceBean bean : beans) {
      Set<Method> attrMethods = HandlerMethodSelector.selectMethods(bean.getBeanType(), MODEL_ATTRIBUTE_METHODS);
View Full Code Here

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

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

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

  protected void detectResourceHandlers(ApplicationContext appContext) {
    logger.debug("Looking for resource handler mappings");

    Map<String, SimpleUrlHandlerMapping> map = appContext.getBeansOfType(SimpleUrlHandlerMapping.class);
    List<SimpleUrlHandlerMapping> handlerMappings = new ArrayList<SimpleUrlHandlerMapping>(map.values());
    Collections.sort(handlerMappings, new OrderComparator());

    for (SimpleUrlHandlerMapping hm : handlerMappings) {
      for (String pattern : hm.getHandlerMap().keySet()) {
        Object handler = hm.getHandlerMap().get(pattern);
        if (handler instanceof ResourceHttpRequestHandler) {
View Full Code Here

        getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1")));
    PerTargetAspect aspect2 = new PerTargetAspect();
    aspect2.setOrder(5);
    advisors.addAll(
        getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2")));
    Collections.sort(advisors, new OrderComparator());

    TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class);
    assertEquals("Around advice must NOT apply", realAge, itb.getAge());

    // Hit the method in the per clause to instantiate the aspect
View Full Code Here

    advisors.addAll(
        getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1")));
    PerTargetAspectWithOrderAnnotation5 aspect2 = new PerTargetAspectWithOrderAnnotation5();
    advisors.addAll(
        getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2")));
    Collections.sort(advisors, new OrderComparator());

    TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class);
    assertEquals("Around advice must NOT apply", realAge, itb.getAge());

    // Hit the method in the per clause to instantiate the aspect
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

      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

TOP

Related Classes of org.springframework.core.OrderComparator$OrderSourceProvider

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.