当前位置: 首页>>代码示例>>Java>>正文


Java Order.value方法代码示例

本文整理汇总了Java中org.springframework.core.annotation.Order.value方法的典型用法代码示例。如果您正苦于以下问题:Java Order.value方法的具体用法?Java Order.value怎么用?Java Order.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.core.annotation.Order的用法示例。


在下文中一共展示了Order.value方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOrder

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
/**
 * Determine the order for this factory's target aspect, either
 * an instance-specific order expressed through implementing the
 * {@link org.springframework.core.Ordered} interface (only
 * checked for singleton beans), or an order expressed through the
 * {@link org.springframework.core.annotation.Order} annotation
 * at the class level.
 * @see org.springframework.core.Ordered
 * @see org.springframework.core.annotation.Order
 */
@Override
public int getOrder() {
	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 = AnnotationUtils.findAnnotation(type, Order.class);
		if (order != null) {
			return order.value();
		}
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:BeanFactoryAspectInstanceFactory.java

示例2: getOrderForAspectClass

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
/**
 * Determine a fallback order for the case that the aspect instance
 * does not express an instance-specific order through implementing
 * the {@link org.springframework.core.Ordered} interface.
 * <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
 * @param aspectClass the aspect class
 */
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
	if (order != null) {
		return order.value();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:SimpleMetadataAwareAspectInstanceFactory.java

示例3: getOrderForAspectClass

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
/**
 * Check whether the aspect class carries an
 * {@link org.springframework.core.annotation.Order} annotation,
 * falling back to {@code Ordered.LOWEST_PRECEDENCE}.
 * @see org.springframework.core.annotation.Order
 */
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
	if (order != null) {
		return order.value();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SingletonMetadataAwareAspectInstanceFactory.java

示例4: returnPrimaryOrHighestPriorityBean

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
private Object returnPrimaryOrHighestPriorityBean(List<Bean> beans) {

			long highestPriority = Integer.MIN_VALUE;
			Object highestPrioBean = null;

			for (Bean bean : beans) {

				if (bean.isPrimary()) {
					return bean.getInstance();
				}

				// TODO figure out to retrieve order from BeanDefinition /
				// BeanDeclaration

				Object instance = bean.getInstance();
				Order order = instance.getClass().getAnnotation(Order.class);
				if (order != null) {
					if (order.value() > highestPriority) {
						highestPriority = order.value();
						highestPrioBean = instance;
					}
				}

				Priority priority = instance.getClass().getAnnotation(Priority.class);
				if (priority != null) {
					if (priority.value() > highestPriority) {
						highestPriority = priority.value();
						highestPrioBean = instance;
					}
				}
			}

			return highestPrioBean;
		}
 
开发者ID:thomasdarimont,项目名称:spring-boot-cdi-instance-example,代码行数:35,代码来源:CustomAutowireCandidateResolver.java

示例5: getOrder

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
/**
 * Determine the order for this factory's target aspect, either
 * an instance-specific order expressed through implementing the
 * {@link org.springframework.core.Ordered} interface (only
 * checked for singleton beans), or an order expressed through the
 * {@link org.springframework.core.annotation.Order} annotation
 * at the class level.
 * @see org.springframework.core.Ordered
 * @see org.springframework.core.annotation.Order
 */
public int getOrder() {
	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 = AnnotationUtils.findAnnotation(type, Order.class);
		if (order != null) {
			return order.value();
		}
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:24,代码来源:BeanFactoryAspectInstanceFactory.java

示例6: initOrderFromBeanType

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
private static int initOrderFromBeanType(Class<?> beanType) {
	Order ann = AnnotationUtils.findAnnotation(beanType, Order.class);
	return (ann != null ? ann.value() : Ordered.LOWEST_PRECEDENCE);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ControllerAdviceBean.java

示例7: getOrder

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
@Override
public int getOrder() {
	Order order = getMethodAnnotation(Order.class);
	return (order != null ? order.value() : 0);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:ApplicationListenerMethodAdapter.java

示例8: resolveOrder

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
protected int resolveOrder(Method method) {
    Order ann = AnnotatedElementUtils.findMergedAnnotation(method, Order.class);
    return (ann != null ? ann.value() : 0);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:UiEventListenerMethodAdapter.java

示例9: initOrderFromBeanType

import org.springframework.core.annotation.Order; //导入方法依赖的package包/类
private static int initOrderFromBeanType(Class<?> beanType) {
	Order annot = AnnotationUtils.findAnnotation(beanType, Order.class);
	return (annot != null) ? annot.value() : Ordered.LOWEST_PRECEDENCE;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:5,代码来源:ControllerAdviceBean.java


注:本文中的org.springframework.core.annotation.Order.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。