Package org.springframework.core.annotation

Examples of org.springframework.core.annotation.Order


            if (obj instanceof Ordered) {
                return ((Ordered) obj).getOrder();
            }
            if (obj != null) {
                Class<?> clazz = (obj instanceof Class ? (Class<?>) obj : obj.getClass());
                Order order = AnnotationUtils.findAnnotation(clazz,Order.class);
                if (order != null) {
                    return order.value();
                }
            }
            return Ordered.LOWEST_PRECEDENCE;
        }
View Full Code Here


    Class type = this.beanFactory.getType(this.name);
    if (type != null) {
      if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
        return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
      }
      Order order = (Order) type.getAnnotation(Order.class);
      if (order != null) {
        return order.value();
      }
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

   * {@link org.springframework.core.annotation.Order} annotation,
   * falling back to <code>Ordered.LOWEST_PRECEDENCE</code>.
   * @see org.springframework.core.annotation.Order
   */
  protected int getOrderForAspectClass(Class aspectClass) {
    Order order = (Order) aspectClass.getAnnotation(Order.class);
    if (order != null) {
      return order.value();
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

   * the {@link org.springframework.core.Ordered} interface.
   * <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
   * @param aspectClass the aspect class
   */
  protected int getOrderForAspectClass(Class aspectClass) {
    Order order = (Order) aspectClass.getAnnotation(Order.class);
    if (order != null) {
      return order.value();
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

    this.beanFactory = beanFactory;
    this.order = initOrderFromBeanType(this.beanFactory.getType(beanName));
  }

  private static int initOrderFromBeanType(Class<?> beanType) {
    Order annot = AnnotationUtils.findAnnotation(beanType, Order.class);
    return (annot != null) ? annot.value() : Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

    Class<?> type = this.beanFactory.getType(this.name);
    if (type != null) {
      if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
        return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
      }
      Order order = type.getAnnotation(Order.class);
      if (order != null) {
        return order.value();
      }
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

   * falling back to <code>Ordered.LOWEST_PRECEDENCE</code>.
   * @see org.springframework.core.annotation.Order
   */
  @Override
  protected int getOrderForAspectClass(Class<?> aspectClass) {
    Order order = aspectClass.getAnnotation(Order.class);
    if (order != null) {
      return order.value();
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

   * <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
   * @param aspectClass the aspect class
   */
  @Override
  protected int getOrderForAspectClass(Class<?> aspectClass) {
    Order order = aspectClass.getAnnotation(Order.class);
    if (order != null) {
      return order.value();
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

    Class type = this.beanFactory.getType(this.name);
    if (type != null) {
      if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
        return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
      }
      Order order = (Order) type.getAnnotation(Order.class);
      if (order != null) {
        return order.value();
      }
    }
    return Ordered.LOWEST_PRECEDENCE;
  }
View Full Code Here

*/
public class SpringAnnotationOrderResolver implements OrderResolver {

    @Override
    public int orderOf(EventListener listener) {
        Order order = AnnotationUtils.findAnnotation(listener.getClass(), Order.class);
        if (order == null && listener instanceof EventListenerProxy) {
            order = AnnotationUtils.findAnnotation(((EventListenerProxy) listener).getTargetType(), Order.class);
        }
        return order == null ? 0 : order.value();
    }
View Full Code Here

TOP

Related Classes of org.springframework.core.annotation.Order

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.