本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例7: getOrder
import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
@Override
public int getOrder() {
Order order = getMethodAnnotation(Order.class);
return (order != null ? order.value() : 0);
}
示例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);
}
示例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;
}